You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by alexworden <al...@gmail.com> on 2008/05/21 02:17:24 UTC
How can I tell which log4j configuration file is being used?
In the past I've set an environment variable to force log4j to output which
log4j config file it is using - but I'll be damned if I can remember of find
any trace of it again on the web.
Can anyone help?
Thanks,
Alex
--
View this message in context: http://www.nabble.com/How-can-I-tell-which-log4j-configuration-file-is-being-used--tp17353608p17353608.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: How can I tell which log4j configuration file is being used?
Posted by Rob Davis-5 <te...@robertjdavis.co.uk>.
The logic for selecting the configuration file is in the LogManager.java
log4j class.
The environment variable you're looking for might be:
DEFAULT_INIT_OVERRIDE_KEY
Do you remember where you set this?
I'd like to know how you stop it looking at both files and instead allow the
user to do BasicConfigurator.configure();
First log4j will look for the log4j.properties files
Then if it doesnt find this it will look for the log4j.xml file
If you want to see which one is has selected, use -Dlog4j.debug in your JVM
arguments when you run your program.
--
View this message in context: http://www.nabble.com/How-can-I-tell-which-log4j-configuration-file-is-being-used--tp17353608p17364347.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: How can I tell which log4j configuration file is being used?
Posted by Curt Arnold <ca...@apache.org>.
Setting the log4j.debug system property to true should cause log4j
internal diagnostic messages to be displayed to the console.
java -Dlog4j.debug=true ....
On May 20, 2008, at 7:17 PM, alexworden wrote:
>
> In the past I've set an environment variable to force log4j to
> output which
> log4j config file it is using - but I'll be damned if I can remember
> of find
> any trace of it again on the web.
>
> Can anyone help?
>
> Thanks,
>
> Alex
>
> --
> View this message in context: http://www.nabble.com/How-can-I-tell-which-log4j-configuration-file-is-being-used--tp17353608p17353608.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org