[ https://issues.apache.org/jira/browse/SLING-6220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chetan Mehrotra updated SLING-6220: ----------------------------------- Fix Version/s: Commons Log 5.0.2 > [log] Perform initial configuration from framework properties synchronously > --------------------------------------------------------------------------- > > Key: SLING-6220 > URL: https://issues.apache.org/jira/browse/SLING-6220 > Project: Sling > Issue Type: Improvement > Components: Commons > Reporter: Felix Meschberger > Fix For: Commons Log 5.0.2 > > > {{LogbackManager}} uses {{LogConfigManager}} to support traditional logging > configuration including initial (global) configuration from framework > properties. Once everything is setup the {{LogbackManager.configChanged()}} > method is called to initiate logging for the first time. > Unfortunately {{configChanged}} is processed asynchronously leading to > initial configuration to be applied only later - in some special use cases > even *after* the complete application has already started. > I proposed to replace the call to {{configChanged()}} by a call to > {{configure()}} which actually implements the configuration change *before* > the {{started}} flag is set to {{true}}. > Proposed patch: > {code} > Index: > src/main/java/org/apache/sling/commons/log/logback/internal/LogbackManager.java > =================================================================== > --- > src/main/java/org/apache/sling/commons/log/logback/internal/LogbackManager.java > (Revision 1767024) > +++ > src/main/java/org/apache/sling/commons/log/logback/internal/LogbackManager.java > (Arbeitskopie) > @@ -167,8 +167,13 @@ > registerWebConsoleSupport(); > registerEventHandler(); > > + // initial configuration must be done synchronously (aka immediately) > + addInfo("LogbackManager: BEGIN initial configuration"); > + configure(); > + addInfo("LogbackManager: END initialconfiguration"); > + > + // now open the gate for regular configuration > started = true; > - configChanged(); > } > > public void shutdown() { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)