If you are in an app server you can use JNDI and get properties from there.
David > On 9 Jan 2014, at 10:44, Mike Müller <[email protected]> wrote: > > Yes, there are different systems with the same configuration running on the > same server. Each system gets the path derived from the path where the app > is installed. So system properties are not a solution. > > best regards > mike > >> -----Original Message----- >> From: Logback-user [mailto:[email protected]] On Behalf Of David >> Roussel >> Sent: Thursday, January 09, 2014 10:34 AM >> To: logback users list >> Cc: [email protected] >> Subject: Re: [logback-user] ReconfigureOnChangeFilter does not reuse context >> properties? >> >> I've not hit this problem before because I just used system properties to >> pass info >> into the logging setup. >> >> Is there some reason why you can't use system properties? >> >> David >> >>> On 9 Jan 2014, at 08:59, Mike Müller <[email protected]> wrote: >>> >>> Hi >>> >>> 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"> >>> <file>${pathToLogs}mysign-cms.log</file> >>> <Append>false</Append> >>> <encoder> >>> <pattern>%d %30.30t %-5p %45.45c - %m%n</pattern> >>> </encoder> >>> </appender> >>> <appender name="R" class="ch.qos.logback.core.FileAppender"> >>> <file>${pathToLogs}log.log</file> >>> <Append>false</Append> >>> <encoder> >>> <pattern>%d %30.30t %-5p %45.45c - %m%n</pattern> >>> </encoder> >>> </appender> <logger name="ch.mysign" additivity="false" level="INFO"> >>> <appender-ref ref="cms"/> >>> </logger> >>> <root level="WARN"> >>> <appender-ref ref="R"/> >>> </root> >>> </configuration> >>> >>> >>> The parameter ${pathToLogs} comes from the following code: >>> >>> LoggerContext context = (LoggerContext) >> LoggerFactory.getILoggerFactory(); >>> >>> try >>> { >>> JoranConfigurator configurator = new JoranConfigurator(); >>> configurator.setContext( context ); >>> context.reset(); >>> 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 >>> Mike >>> _______________________________________________ >>> Logback-user mailing list >>> [email protected] >>> http://mailman.qos.ch/mailman/listinfo/logback-user >> _______________________________________________ >> Logback-user mailing list >> [email protected] >> http://mailman.qos.ch/mailman/listinfo/logback-user > _______________________________________________ > Logback-user mailing list > [email protected] > http://mailman.qos.ch/mailman/listinfo/logback-user _______________________________________________ Logback-user mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/logback-user
