[Bug 128] New: Multiple applications sharing the same config file

http://bugzilla.qos.ch/show_bug.cgi?id=128 Summary: Multiple applications sharing the same config file Product: logback-classic Version: unspecified Platform: PC URL: http://marc.info/?t=120308330000003&r=1&w=2 OS/Version: Windows Status: NEW Severity: enhancement Priority: P1 Component: Other AssignedTo: logback-dev@qos.ch ReportedBy: noreply.ceki@qos.ch The idea is to have a number of applications (over 20) to share the same config file so that the log output goes to different files. -- 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.

http://bugzilla.qos.ch/show_bug.cgi?id=128 ------- Comment #1 from mbosteels.dns@gmail.com 2008-02-16 23:17 ------- Ceki, After this discussion on the log4j mailing list, I had a look at logback to see if it supports passing in a java.utils.Properties for resolving placeholders. I guess for now only System properties are supported, right ? Maarten -- 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.

http://bugzilla.qos.ch/show_bug.cgi?id=128 ------- Comment #2 from noreply.ceki@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.

http://bugzilla.qos.ch/show_bug.cgi?id=128 ------- Comment #3 from mbosteels.dns@gmail.com 2008-02-17 20:41 ------- Yes, I had read chapter 3 in the manual, and I had seen the setProperty method in the Context, just didn't have time yet to try it out. That would work for me. Will try it tomorrow. Maybe this option should be added to the documentation ? -- 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.
participants (1)
-
bugzilla-daemon@pixie.qos.ch