Package org.apache.logging.log4j.core.appender

Examples of org.apache.logging.log4j.core.appender.RollingFileAppender


    public void testAccessManager() throws IOException {
        final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
        final Configuration config = ctx.getConfiguration();
        final File file = File.createTempFile("RollingFileAppenderAccessTest", ".tmp");
        file.deleteOnExit();
        final RollingFileAppender appender = RollingFileAppender.createAppender(file.getCanonicalPath(), "FilePattern",
                null, "Name", null, null, OnStartupTriggeringPolicy.createPolicy(), null, null, null, null, null, null,
                config);
        final RollingFileManager manager = appender.getManager();
        // Since the RolloverStrategy and TriggeringPolicy are immutable, we could also use generics to type their
        // access.
        manager.getRolloverStrategy();
        manager.getTriggeringPolicy();
    }
View Full Code Here


    private void ensureOnlyDefaultAppender() throws Exception
    {
        assertThat(1, equalTo(appendersCount(APP_NAME)));
        assertThat(1, equalTo(selectByClass(APP_NAME, RollingFileAppender.class).size()));

        RollingFileAppender fileAppender = (RollingFileAppender) selectByClass(APP_NAME, RollingFileAppender.class).get(0);
        assertThat("defaultFileAppender", equalTo(fileAppender.getName()));
        assertThat(fileAppender.getFileName(), containsString(String.format("mule-app-%s.log", APP_NAME)));
    }
View Full Code Here

        }
    }

    private void addDefaultAppender(MuleLoggerContext context, String logFilePath)
    {
        RollingFileAppender appender = createRollingFileAppender(logFilePath, "'.'%d{yyyy-MM-dd}", "defaultFileAppender", context.getConfiguration());
        doAddAppender(context, appender);
    }
View Full Code Here

TOP

Related Classes of org.apache.logging.log4j.core.appender.RollingFileAppender

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.