Search in sources :

Example 1 with NullAppender

use of org.apache.logging.log4j.core.appender.NullAppender in project logging-log4j2 by apache.

the class Log4j1ConfigurationFactoryTest method testNullAppender.

@Test
public void testNullAppender() throws Exception {
    final Configuration configuration = getConfiguration("config-1.2/log4j-NullAppender.properties");
    final Appender appender = configuration.getAppender("NullAppender");
    assertNotNull(appender);
    assertEquals("NullAppender", appender.getName());
    assertTrue(appender.getClass().getName(), appender instanceof NullAppender);
}
Also used : Appender(org.apache.logging.log4j.core.Appender) NullAppender(org.apache.logging.log4j.core.appender.NullAppender) ConsoleAppender(org.apache.logging.log4j.core.appender.ConsoleAppender) FileAppender(org.apache.logging.log4j.core.appender.FileAppender) RollingFileAppender(org.apache.logging.log4j.core.appender.RollingFileAppender) Configuration(org.apache.logging.log4j.core.config.Configuration) NullAppender(org.apache.logging.log4j.core.appender.NullAppender) Test(org.junit.Test)

Aggregations

Appender (org.apache.logging.log4j.core.Appender)1 ConsoleAppender (org.apache.logging.log4j.core.appender.ConsoleAppender)1 FileAppender (org.apache.logging.log4j.core.appender.FileAppender)1 NullAppender (org.apache.logging.log4j.core.appender.NullAppender)1 RollingFileAppender (org.apache.logging.log4j.core.appender.RollingFileAppender)1 Configuration (org.apache.logging.log4j.core.config.Configuration)1 Test (org.junit.Test)1