TimeBasedRollingPolicy statusesRollingPolicy = new TimeBasedRollingPolicy();
statusesRollingPolicy.setFileNamePattern("statuses.log" + HOUR_ROLL);
statusesRollingPolicy.activateOptions();
RollingFileAppender statusesAppender = new RollingFileAppender();
statusesAppender.setRollingPolicy(statusesRollingPolicy);
statusesAppender.addFilter(filter);
statusesAppender.setLayout(layoutSimple);
statusesAppender.activateOptions();
TimeBasedRollingPolicy warningsRollingPolicy = new TimeBasedRollingPolicy();
warningsRollingPolicy.setFileNamePattern("warnings.log" + HOUR_ROLL);
warningsRollingPolicy.activateOptions();
RollingFileAppender warningsAppender = new RollingFileAppender();
warningsAppender.setRollingPolicy(statusesRollingPolicy);
warningsAppender.setThreshold(Level.WARN);
warningsAppender.setLayout(layoutStandard);
warningsAppender.activateOptions();
ConsoleAppender consoleAppender = new ConsoleAppender();
consoleAppender.setThreshold(Level.WARN);
consoleAppender.setLayout(layoutStandard);
consoleAppender.activateOptions();