[logback-user] Repost: ReconfigureOnChangeFilter does not reuse context properties?

Mike Müller mikedev at mysign.ch
Wed Feb 19 14:01:31 CET 2014


At the risk of beeing annoying, I repost my question - in our production environment this is really a problem:

-----Original Message-----
From: Logback-user [mailto:logback-user-bounces at qos.ch] On Behalf Of Mike Müller
Sent: Thursday, January 09, 2014 10:00 AM
To: 'logback-user at qos.ch'
Subject: [logback-user] ReconfigureOnChangeFilter does not reuse context properties?


I'm using a config file wich looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<configuration scan="true" scanPeriod="60 seconds" > <appender name="cms" class="ch.qos.logback.core.FileAppender">
      <pattern>%d %30.30t %-5p %45.45c - %m%n</pattern>
  <appender name="R" class="ch.qos.logback.core.FileAppender">
      <pattern>%d %30.30t %-5p %45.45c - %m%n</pattern>
  </appender>  <logger name="ch.mysign" additivity="false" level="INFO">
    <appender-ref ref="cms"/>
  <root level="WARN">
    <appender-ref ref="R"/>

The parameter ${pathToLogs} comes from the following code:

            LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
		JoranConfigurator configurator = new JoranConfigurator();
		configurator.setContext( context );
		context.putProperty( "pathToLog", "my-path-to-the-external-logs" );
		configurator.doConfigure("my-logback-config.xml" );
	catch ( JoranException je )
		System.out.println( je.getMessage() );

If I change the config file, the property "pathToLog" gets lost. Is this the same issue as descibed in [1]? If yes, is it a problem to reuse the context or at least the properties of the old context?

[1] http://jira.qos.ch/browse/LOGBACK-592

best regards
Logback-user mailing list
Logback-user at qos.ch

More information about the Logback-user mailing list