My project recently migrated from log4j to log4j2 using the bridge approach. Everything works well until we trigger a flow that uses a 3rd party jar which is programmatically reconfiguring log4j. This reconfiguration is done using org.apache.log4j.PropertyConfigurator (log4j-1.2-api-2.17.2). Due to this reconfiguration, my Log4j2 property configuration is getting hijacked closing all the appenders. I have the log4j2.properties on my class path and a System Property is also set to refer log4j2.configurationFile. I enabled the debug and it is printing the the reconfig logs. Please advise how can this programmatic reconfig. can be disabled.
Application is a java based webapp deployed on Websphere.
SystemErr R DEBUG StatusLogger PluginManager ‘Lookup’ found 15 plugins
SystemErr R DEBUG StatusLogger PluginManager ‘Log4j Builder’ found 19 plugins
SystemErr R DEBUG StatusLogger Could not find root logger information. Is this OK?
SystemErr R DEBUG StatusLogger Handling log4j.additivity.org.apache.axis=[null]
SystemErr R DEBUG StatusLogger Parsing for [org.apache.axis] with value=[OFF].
SystemErr R DEBUG StatusLogger Level token is [OFF].
SystemErr R DEBUG StatusLogger Logger org.apache.axis level set to FATAL
SystemErr R DEBUG StatusLogger Finished configuring.
SystemErr R DEBUG StatusLogger Could not find root logger information. Is this OK?
SystemErr R DEBUG StatusLogger Parsing for [org.apache.axis] with value=[OFF].
SystemErr R DEBUG StatusLogger Level token is [OFF].
SystemErr R DEBUG StatusLogger Logger org.apache.axis level set to FATAL
SystemErr R DEBUG StatusLogger Finished configuring.
SystemErr R DEBUG StatusLogger Configuration org.apache.log4j.config.PropertiesConfiguration@fbb7db8e initialized
SystemErr R DEBUG StatusLogger Starting configuration org.apache.log4j.config.PropertiesConfiguration@fbb7db8e
SystemErr R DEBUG StatusLogger Started configuration org.apache.log4j.config.PropertiesConfiguration@fbb7db8e OK.
SystemErr R TRACE StatusLogger Stopping org.apache.logging.log4j.core.config.properties.PropertiesConfiguration@983595e…
SystemErr R TRACE StatusLogger PropertiesConfiguration notified 3 ReliabilityStrategies that config will be stopped.
SystemErr R TRACE StatusLogger PropertiesConfiguration stopping 2 LoggerConfigs.
SystemErr R TRACE StatusLogger PropertiesConfiguration stopping root LoggerConfig.
SystemErr R TRACE StatusLogger PropertiesConfiguration notifying ReliabilityStrategies that appenders will be stopped.
SystemErr R TRACE StatusLogger PropertiesConfiguration stopping remaining Appenders.
SystemErr R DEBUG StatusLogger Appender AppFileAppender stopped with status true
SystemErr R DEBUG StatusLogger Appender PerfFileAppender stopped with status true
SystemErr R DEBUG StatusLogger Appender consoleAppender stopped with status true
SystemErr R TRACE StatusLogger PropertiesConfiguration stopped 3 remaining Appenders.
SystemErr R TRACE StatusLogger PropertiesConfiguration cleaning Appenders from 3 LoggerConfigs.
SystemErr R DEBUG StatusLogger Stopped
Tried multiple options 1. with different properties 2. programmatic configuration 3.setting monitorInterval=0 but nothing works as the log4j2 Property Configuration it self is getting stopped. Only way it works as expected is if we remove PropertiesConfiguration class from bridge jar.
Vnem is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.