[logback-user] RE: [logback-user] add property for specifying logback.xmlfilelocation
Gerweck Andy - agerwe
Andy.Gerweck at acxiom.com
Thu Feb 8 21:54:19 CET 2007
I'm another happy, impressed LOGBack user who has very similar needs. Where I develop, we have several different deployment levels, all of which require substantially different logging configurations (e.g., development, qa, staging, production). However, our standard rollout procedure currently produces one standard build, as a zip file, for QA and above. We control the configuration in our startup with a few environment variables.
As I start to push for my team's adoption of LOGBack, some mechanism like the one proposed below will be essential. I can't see any reason why I couldn't include a base logging configuration file in the classpath as a springboard to the configurable logging location. It would be convenient to specify the location for quick-and-dirty hacks, but I could live without it. The only drawback is that Log4j offers this, so there may be some in my group who protest changing to an implementation they may call +IBw-incomplete.+IB0- That said, if I could only have one, it would definitely be the inclusion mechanism.
I+IBk-m not yet familiar with Joran, but it would be great if we could include some configure kind of mapping that along the lines of the below (pidgin pseudocode, but I think it's pretty clear).
logName +AD0-
case ENV+AHs-'env'+AH0- of
'qa' -+AD4- 'qa-logback.xml'
'dev' -+AD4- 'log-dev.xml'
'prod' -+AD4- 'logback.xml'
logLocation +AD0- concat(ENV+AHs-'root'+AH0-, '/config/', logName)
As long as I can control the location of the file with an environment variable, I can make things work, but it would be great to make the file location a function of one or more variables as above.
Thank you,
Andy Gerweck
-----Original Message-----
From: logback-user-bounces+AEA-qos.ch +AFs-mailto:logback-user-bounces+AEA-qos.ch+AF0- On Behalf Of Ceki G+APw-lc+APw-
Sent: Thursday, February 08, 2007 11:51 AM
To: logback users list
Subject: RE: +AFs-logback-user+AF0- add property for specifying logback.xmlfilelocation
Hi Michael,
What you propose makes sense. However, I'd like to limit the number of ways
logback can be configured (to ease the brain-footprint of logback on our
users.) How about if we allowed a config file to include parts from a
different sources? This inclusion feature should allow you to reference a
different file. Moreover, since Joran supports variable substitution, you
could set the value of the variable through a system property. You would
get the feature you are asking for, and we would keep the initialization
procedure simple (err, simpler.).
WDYT?
If you agree, could you please file a bug report asking for inclusion
feature in joran/logback?
At 07:08 PM 2/8/2007, Newcomb, Michael-P57487 wrote:
+AD4-If I have multiple tests that measure performance, debugging, vs. ??? I
+AD4-don't want to change the file or have duplicate files in different directories.
+AD4-
+AD4-Look at the logback examples directory.
+AD4-logback-0.9+AFw-logback-examples+AFw-src+AFw-main+AFw-java+AFw-chapter2+AFw-
+AD4-
+AD4-There are 3 different configuration files. I don't want any code
+AD4-dependencies on Logback so the only way to configure logback is to use a
+AD4-file called logback.xml or logback-test.xml.
+AD4-
+AD4-To execute chapter 2 I would have to copy those files to logback.xml or
+AD4-logback-test.xml. Or put them in different directories and rename them all
+AD4-to the same file name.
+AD4-
+AD4-Thanks,
+AD4-Michael
+AD4-
+AD4------Original Message-----
+AD4-From: logback-user-bounces+AEA-qos.ch +AFs-mailto:logback-user-bounces+AEA-qos.ch+AF0- On
+AD4-Behalf Of Sebastien Pennec
+AD4-Sent: Thursday, February 08, 2007 12:36 PM
+AD4-To: logback users list
+AD4-Subject: Re: +AFs-logback-user+AF0- add property for specifying logback.xml
+AD4-filelocation
+AD4-
+AD4-Hello Michael,
+AD4-
+AD4-At the moment, logback can load two different files: logback.xml and
+AD4-logback-test.xml. They need to be in the classpath and can be useful to
+AD4-separate the environments, e.g. development and production.
+AD4-
+AD4-This behavior is usually enough for many situations.
+AD4-
+AD4-Can you precise your request with a use case that would need a java
+AD4-variable and would not be possible with the actual behavior?
+AD4-
+AD4-Thanks,
+AD4-
+AD4-S+AOk-bastien
+AD4-
+AD4-
+AD4-Newcomb, Michael-P57487 wrote:
+AD4- +AD4- e.g.:
+AD4- +AD4- -Dch.qos.logback.config+AD0-foo/bar/my-logback.xml
+AD4- +AD4-
+AD4- +AD4- Thanks,
+AD4- +AD4- Michael
+AD4- +AD4-
+AD4- +AD4-
+AD4- +AD4- ----------------------------------------------------------------------
+AD4- +AD4- --
+AD4- +AD4-
+AD4- +AD4- +AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXw-
+AD4- +AD4- Logback-user mailing list
+AD4- +AD4- Logback-user+AEA-qos.ch
+AD4- +AD4- http://qos.ch/mailman/listinfo/logback-user
+AD4-
+AD4---
+AD4-S+AOk-bastien Pennec
+AD4-sebastien+AEA-qos.ch
+AD4-
+AD4-Logback: The reliable, generic, fast and flexible logging framework for Java.
+AD4-http://logback.qos.ch/
+AD4-+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXw-
+AD4-Logback-user mailing list
+AD4-Logback-user+AEA-qos.ch
+AD4-http://qos.ch/mailman/listinfo/logback-user
+AD4-+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXw-
+AD4-Logback-user mailing list
+AD4-Logback-user+AEA-qos.ch
+AD4-http://qos.ch/mailman/listinfo/logback-user
--
Ceki G+APw-lc+APw-
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXw-
Logback-user mailing list
Logback-user+AEA-qos.ch
http://qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http:+AC8ALw-qos.ch+AC8-pipermail+AC8-logback-user+AC8-attachments+AC8-20070208+AC8-2b3dae7e+AC8-attachment.htm
-------------- next part --------------
***************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.
If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.
If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.
Thank You.
****************************************************************************
More information about the Logback-user
mailing list