logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: Properties not loaded?
Date Thu, 10 Oct 2002 11:10:42 GMT
At 12:01 10.10.2002 +0100, you wrote:
>When I set the system property using "java
>-Dlog4j.configuration=/mydir/log4j.properties myClass"
>I do not get the properties held in here picked up. I though if I specified
>this property I would never have to invoke the
>PropertyConfigurator.configure or PropertyConfigurator.basicConfiguration

That is correct. Does the file /mydir/log4j.properties exist? The file 
should be picked up. Try setting log4j.debug=true and observe the results.

>If I do can you suggest a was to call this if I don't have access
>to the enter point of the application. Currently I have to put a static
>initialized in every class that logs.

That's an anti-pattern that you must avoid.



TCP implementations will follow a general principle of robustness: be
conservative in what you do, be liberal in what you accept from
others. -- Jon Postel, RFC 793

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

View raw message