On 24.02.2011 12:26, Jacob Kjome wrote:
-Dlog4j.defaultInitOverride=true
-Dlog4j.configuration=file:/url/path/to/log4j.xml

See more at...
http://logging.apache.org/log4j/1.2/manual.html#defaultInit
For the record, the -Dlog4j.defaultInitOverride should *not* be used, if all one is changing is the location of the configuration file. When I set both of these flags, I get:

   log4j: Default initialization of overridden by
   log4j.defaultInitOverrideproperty.
   log4j:WARN No appenders could be found for logger
   (org.serviio.console.ServiioConsole).
   log4j:WARN Please initialize the log4j system properly.

Removing the flag -- and using the -Dlog4j.configuration /only/ -- causes the specified file to be properly parsed and everything gets peachy...

I guess, one would want to override the default initialization if one's application does its own configuration somehow. If all you are changing is the config-file location, then you still want the default initialization procedure to take place -- just with a different input.

Yours,

   -mi

Reply via email to