Mercurial > stress-tester
changeset 524:73fa34b62fa1
Log4jConfigurationFactory.asyncLoggerContext
author | Devel 2 |
---|---|
date | Fri, 25 Aug 2017 11:38:23 +0200 |
parents | 433b21bb546f |
children | 924eac805b34 |
files | stress-tester/src/main/java/com/passus/st/Log4jConfigurationFactory.java |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/Log4jConfigurationFactory.java Fri Aug 25 11:35:47 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/Log4jConfigurationFactory.java Fri Aug 25 11:38:23 2017 +0200 @@ -19,6 +19,8 @@ private static Level level = Level.DEBUG; + public static boolean asyncLoggerContext = true; + static Configuration createConfiguration(final String name, ConfigurationBuilder<BuiltConfiguration> builder) { builder.setConfigurationName(name); builder.setStatusLevel(Level.ERROR); @@ -59,7 +61,10 @@ public static void enableFactory(Level level) { System.setProperty("log4j.configurationFactory", "com.passus.st.Log4jConfigurationFactory"); - System.setProperty("Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"); + if (asyncLoggerContext) { + System.setProperty("Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"); + } + Log4jConfigurationFactory.level = level; }