Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
0.9.27
-
None
Description
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.
// 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()); } } };
It should somehow be possible to inherit the custom substitution properties into the new JoranConfigurator. Otherwise they are lost on re-configuration.