logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcos <mar...@softingsystems.com.br>
Subject Re: Log4J XML configuration file for a library on classpath
Date Mon, 23 Apr 2007 17:57:32 GMT
James Stauffer escreveu:

> Generally adding log4j.xml to a directory in the classpath will work.
> Did you try that?

Hi,

First of all thanks for answer :-)
I've added the log4j.xml to the classpath and it worked :-) as you 
recommended :-), but I made it in a "not so elegant way", I mean I've 
added the file below the folder "build\classes" 
(build\classes\log4j.xml) in my IDE.

I found a tip on the manual at 
http://logging.apache.org/log4j/docs/manual.html that states.:

"...Set the resource string variable to the value of the 
log4j.configuration system property. The preferred way to specify the 
default initialization file is through the log4j.configuration system 
property. In case the system property log4j.configuration is not 
defined, then set the string variable resource to its default value 
"log4j.properties"...."

So my own the question.:

>> Q2. Is possible to force the location for the configuration files
>> (log4j.xml/ log4j.properties) through
>>        parameters passed to the VM ?
>
Would be answered as "yes" :-)
You have just to pass the following args to the VM 
"-Dlog4j.configuration=path/to/your/configuration/file/log4j.xml"

Thank you very much !!!

-- 
Marcos H. W.
Softing Systems
Systems Analyst
+55 11 38770360

/** 
 * @see https://jaxb2-commons.dev.java.net
 */

/**
 * "...Use the Force ...;-)" */
 *
 * @see http://www.gentoo.org/
 */



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message