Changing / Retrieving log4j config at runtime

2007-02-16 Thread Gaurav Arora
Hi, I have been trying to retrieve all loggers attached to a root log using a servlet that runs at server startup but I haven't been able to do so yet. I tried using the getAllAppenders method, which the manual says is deprecated and the Hierarchy class as well, both don't seem to work.

Re: Changing / Retrieving log4j config at runtime

2007-02-16 Thread James Stauffer
Look for LogWeb it is a servlet that allows configuring log4j. It will either meet your needs or show you how to do what you want to do. On 2/16/07, Gaurav Arora [EMAIL PROTECTED] wrote: Hi, I have been trying to retrieve all loggers attached to a root log using a servlet that runs at

Re: Changing / Retrieving log4j config at runtime

2007-02-16 Thread zeusfaber
Maybe this is the correct thread ;-) In my application I'm changing and retrieving programmatically logger levels via the: logger.setLevel(...) /getLevel() Then I though to add a restore defaults feature that reloads the original configuration through: DOMConfigurator.configure(xmlFilePath);

Re: Changing / Retrieving log4j config at runtime

2007-02-16 Thread zeusfaber
James Stauffer wrote: For one thing, DOMConfigurator.configure adds to the current config -- it doesn't replace it. Thay is why some loggers still see the changed configuration. Thank you James for you prompt reply. Hummm, this could be the reason I'm seeing strange behaviours. But so,

Re: Changing / Retrieving log4j config at runtime

2007-02-16 Thread zeusfaber
Curt Arnold wrote: A null return from Logger.getLevel() indicates that logger does not have an explicit level, but inherits a level from its parent or their parents. If you return the parent's level in this situation, you can no longer distinguish between a logger who has a level

Re: Changing / Retrieving log4j config at runtime

2007-02-16 Thread James Stauffer
I don't know if this would work but you could try recursing the logger tree removing all appenders and reseting all levels before calling configure. On 2/16/07, zeusfaber [EMAIL PROTECTED] wrote: James Stauffer wrote: For one thing, DOMConfigurator.configure adds to the current config --

logging from jar file

2007-02-16 Thread Jesse Vitrone
In our application, we don't user a log4j.properties, we configure the logger in the code using this: PropertyConfigurator.configure(getProperties()); If we do that, and then use Apache Axis (which uses commons-logging), will it pick up the same configuration? If not, would Axis's