@Test public void testGetFileAppendersFileNames() { File log4jFile = FileUtils.getResourceFileFromContext("log4j2-for-tests.xml"); List<String> fileAppenderNames = Log4JHelper.getFileAppendersFileNames(log4jFile); fileAppenderNames.sort(naturalOrder()); assertEquals(5, fileAppenderNames.size()); assertEquals("classloader.log", fileAppenderNames.get(0)); assertEquals("nuxeo-error.log", fileAppenderNames.get(1)); assertEquals("server.log", fileAppenderNames.get(2)); assertEquals("stderr.log", fileAppenderNames.get(3)); assertEquals("tomcat.log", fileAppenderNames.get(4)); }
public static List<String> getFileAppendersFileNames(Configuration configuration) { List<String> names = new ArrayList<>(); for (Appender appender : configuration.getAppenders().values()) { if (appender instanceof FileAppender) { names.add(((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { names.add(((RollingFileAppender) appender).getFileName()); } } return names; }
Log4JHelper { public static List<String> getFileAppendersFileNames(Configuration configuration) { List<String> names = new ArrayList<>(); for (Appender appender : configuration.getAppenders().values()) { if (appender instanceof FileAppender) { names.add(((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { names.add(((RollingFileAppender) appender).getFileName()); } } return names; } }
Log4JHelper { public static List<String> getFileAppendersFileNames(Configuration configuration) { List<String> names = new ArrayList<>(); for (Appender appender : configuration.getAppenders().values()) { if (appender instanceof FileAppender) { names.add(((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { names.add(((RollingFileAppender) appender).getFileName()); } } return names; }  }
Log4JHelper { public static List<String> getFileAppendersFileNames(Configuration configuration) { List<String> names = new ArrayList<>(); for (Appender appender : configuration.getAppenders().values()) { if (appender instanceof FileAppender) { names.add(((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { names.add(((RollingFileAppender) appender).getFileName()); } } return names; }  static List<String> getFileAppendersFileNames(Configuration configuration); static Configuration newConfiguration(File log4jConfigurationFile); static List<String> getFileAppendersFileNames(File log4jConfigurationFile); static void setLevel(String[] loggerNames, Level level, boolean includeChildren); }
Log4JHelper { public static List<String> getFileAppendersFileNames(Configuration configuration) { List<String> names = new ArrayList<>(); for (Appender appender : configuration.getAppenders().values()) { if (appender instanceof FileAppender) { names.add(((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { names.add(((RollingFileAppender) appender).getFileName()); } } return names; }  static List<String> getFileAppendersFileNames(Configuration configuration); static Configuration newConfiguration(File log4jConfigurationFile); static List<String> getFileAppendersFileNames(File log4jConfigurationFile); static void setLevel(String[] loggerNames, Level level, boolean includeChildren);  }