use of org.apache.log4j.EnhancedPatternLayout in project pwm by pwm-project.
the class MainClass method initLog4j.
private static void initLog4j(final PwmLogLevel logLevel) {
if (logLevel == null) {
Logger.getRootLogger().removeAllAppenders();
Logger.getRootLogger().addAppender(new NullAppender());
PwmLogger.markInitialized();
return;
}
final Layout patternLayout = new EnhancedPatternLayout(LOGGING_PATTERN);
final ConsoleAppender consoleAppender = new ConsoleAppender(patternLayout);
for (final Package logPackage : PwmLogManager.LOGGING_PACKAGES) {
if (logPackage != null) {
final Logger logger = Logger.getLogger(logPackage.getName());
logger.addAppender(consoleAppender);
logger.setLevel(logLevel.getLog4jLevel());
}
}
PwmLogger.markInitialized();
}
Aggregations