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 Richard Bondi <rb...@ergito.com> on 2003/06/27 16:05:38 UTC

log4.configuration confusion

Dear All,

Short version: what am I supposed to do, if anything, after setting 
"log4j.configuration" with -Dlog4.configuration=[my log4j properties file's 
url]
in order for log4j to initialize itself with my log4j properties file?

Long version:

In the short manual http://jakarta.apache.org/log4j/docs/manual.html, the 
default initialization procedure is said to have 5 steps.

The writing is less than completely clear. Step 2 seems to say that if I 
set the system property "log4j.configuration" with the URL of my
log4j properties file, then that's all I need to do: log4j will configure 
itself.

Well, it doesn't: log4j says it can't find appenders in called classes, and 
doesn't execute any of the logging calls in my top class.

However, if I do what Step 4 says to do, and put this in my constructor:

	PropertyConfigurator.configure(System.getProperty("log4j.configuration"));

then everything works fine. But this makes no sense: the property might as 
well be called "gumby.foo" instead of
"log4.configuration" if this is how it's supposed to work.

So: what am I supposed to do, if anything, after setting 
"log4j.configuration" with -Dlog4.configuration=...
in order for log4j to initialize itself with my log4j properties file?

Thanks much for any help,
Richard Bondi


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