[logback-dev] [Bug 128] Multiple applications sharing the same config file
bugzilla-daemon at pixie.qos.ch
bugzilla-daemon at pixie.qos.ch
Sun Feb 17 19:53:47 CET 2008
http://bugzilla.qos.ch/show_bug.cgi?id=128
------- Comment #2 from noreply.ceki at qos.ch 2008-02-17 19:53 -------
Hi Maarten,
Logback supports variable substitution through various means. See
the section entitled Variable substitution in chapter 3 of the manual [1].
There is the substitutionProperty tag which can be used to set single
properties or from a file or a resource.
However, I think that you need a more dynamic behavior. In logback 0.9.9
properties are set per logging context. (Previously they could be also set per
Joran instance via a InterpretationConext).
So, nothing prevents you from setting the properties for the context. For
example the following code should do it:
LoggingContext lc = (LoggingContext) LoggerFactory.getILoggerFactory();
context.setProperty("filename", "c:\myfile.log");
JoranConfigurator jc = new JoranConfigurator();
jc.setContext(context);
jc.doConfigure("...");
Does it makes sense? Would the above work for you?
[1] http://logback.qos.ch/manual/joran.html
--
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the logback-dev
mailing list