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.

On 2/16/07, zeusfaber <[EMAIL PROTECTED]> wrote:

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

Now I' m having problems becouse, *sometimes* *some* loggers still see the
changed configuration.

Sometimes the logger.getLevel() reutrn null so I added a check:

Level level = loggerInstance.getLevel();

if (level == null)
{
  Logger root = Logger.getRootLogger();
  return root.getLevel().toInt();
}

return level.toInt();

Any idea where I'm wrong?

Thank you in advance

--
Davide



--
View this message in context: 
http://www.nabble.com/Changing---Retrieving-log4j-config-at-runtime-tf3238396.html#a9006677
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to