logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juha Laiho <Juha.La...@iki.fi>
Subject Re: log4j.configuration system property not taken into account?
Date Fri, 29 Aug 2008 13:53:34 GMT
Gvd wrote:
> no this brings no help.
> anyway, i receive some other error info now.
> although it still does not work.
> Any Suggestions?
> 
> java -Dlog4j.debug=true
> -Dlog4j.configuration="C:\\Work\\03_eclipse_3_3_0\\workspace\\Log4j128Tester\\conf\\log4j.xml"
> src.MainClass
> log4j: Trying to find
> [C:\\Work\\03_eclipse_3_3_0\\workspace\\Log4j128Tester\\conf\\log4j.xml]
> using context classloader sun.misc.Launcher$AppClassLoader@133056f.
...
> start
> log4j:WARN No appenders could be found for logger (Testappender).
> log4j:WARN Please initialize the log4j system properly.
> end

Ah, got it -- and now I remember having been bitten by this myself as well.
You'll need to prefix the configuration path by "file:", that is, use
java -Dlog4j.debug=true -Dlog4j.configuration="file:C:\\Work\\03_eclipse_3_3_0\\workspace\\Log4j128Tester\\conf\\log4j.xml"
src.MainClass
as your command line.

Also, http://logging.apache.org/log4j/1.2/manual.html seems in "Example 4"
to recommend use of forward slashes in the file paths, so modifying from the above:
java -Dlog4j.debug=true -Dlog4j.configuration="file:/C:/Work/03_eclipse_3_3_0/workspace/Log4j128Tester/conf/log4j.xml"
src.MainClass
-- 
..Juha

---------------------------------------------------------------------
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