logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Sauyet <li...@sauyet.com>
Subject Re: App server session recovery configures log4j too early
Date Thu, 10 Jan 2008 13:58:31 GMT
Jacob Kjome wrote:
> Scott Sauyet wrote:
>> [ ... ] I need to find a way to either configure log4j early on 
>> application server startup, or at least to reconfigure it on demand.
>> [ ... ]
> 
> Take the Log4j config file that depends on setting up system properties 
> out of your classpath.  Put a dummy file in the classpath that does 
> nothing more than set the root logger to "OFF"....
> 
> [ ... ]
> 
> Put your real Log4j config file under something like WEB-INF/ and run 
> configure() when desired.

Oh, this sounds perfect.  I didn't realize it was possible.  It probably 
means I can skip that silly servlet too.  Thank you very much.


> BTW, this also prevents your app from autoconfiguring itself using a 
> config file found in the parent classloader.  It guarantees that your 
> dummy file will be used for auto configuration.


That's not an issue in my test environment, but I could easily see it 
coming up in some production.


Thank you very much for your help.

   -- Scott

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