use of org.apache.logging.log4j.core.appender.CountingNoOpAppender in project elasticsearch by elastic.
the class EvilLoggerTests method testFindAppender.
public void testFindAppender() throws IOException, UserException {
setupLogging("find_appender");
final Logger hasConsoleAppender = ESLoggerFactory.getLogger("has_console_appender");
final Appender testLoggerConsoleAppender = Loggers.findAppender(hasConsoleAppender, ConsoleAppender.class);
assertNotNull(testLoggerConsoleAppender);
assertThat(testLoggerConsoleAppender.getName(), equalTo("console"));
final Logger hasCountingNoOpAppender = ESLoggerFactory.getLogger("has_counting_no_op_appender");
assertNull(Loggers.findAppender(hasCountingNoOpAppender, ConsoleAppender.class));
final Appender countingNoOpAppender = Loggers.findAppender(hasCountingNoOpAppender, CountingNoOpAppender.class);
assertThat(countingNoOpAppender.getName(), equalTo("counting_no_op"));
}
Aggregations