ReconfigureOnChangeFilter should re-use substition properties from initial 
configuration
----------------------------------------------------------------------------------------

                 Key: LBCLASSIC-310
                 URL: http://jira.qos.ch/browse/LBCLASSIC-310
             Project: logback-classic
          Issue Type: Improvement
          Components: joran
    Affects Versions: 0.9.27
            Reporter: Gunnar Wagenknecht
            Assignee: Logback dev list


Logback configuration files are automatically reloaded when {{scan="true"}} is 
set. This is implemented using {{ReconfigureOnChangeFilter}}. The actually 
re-configuration happens in {{ReconfiguringThread}} which always creates a new 
default {{JoranConfigurator}}.

This is works as long as the initial {{JoranConfigurator}} hasn't been extended 
to support additional substitution properties.

{code:java}
// create our customized configurator
final JoranConfigurator configurator = new JoranConfigurator() {
   @Override
   protected void addImplicitRules(final Interpreter interpreter) {
      super.addImplicitRules(interpreter);
      // set some properties for log file substitution
      if (null != instanceLogfileDirectory) {
         
interpreter.getInterpretationContext().addSubstitutionProperty("my.property", 
calculateMyPropertyValue());
      }
   }
};
{code}

It should somehow be possible to inherit the custom substitution properties 
into the new {{JoranConfigurator}}. Otherwise they are lost on re-configuration.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
logback-dev mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-dev

Reply via email to