You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Chad Myers <ch...@chadmyers.com> on 2004/03/30 19:11:03 UTC

Dynamic config: Changing log level of non-root logger

So I've been playing with dynamic log4net configuration using a separate
log4net XML config file.

When I change the file and add a new logger and set its level to
something other than the root level (i.e. root is ERROR, logger1 is
DEBUG), I still only get error messages (because it's just using the
root level).

Note that I have already done DOMConfigurator.ConfigureAndWatch() on
this file and other changes seem to work (like adding/removing
appenders, changing the root log level, etc).

But if, in code, I do:

Hierarchy repository = 
	log4net.LogManager.GetLoggerRepository() as Hierarchy;
repository.Shutdown();
DOMConfigurator.ConfigureAndWatch( configFileInfo );

It will pick up the log level change to logger1 and start logging DEBUG
messages appropriately.

Is there a bug here, or is there something I'm missing about log levels?

Are log levels a special beast that requires rebooting log4net to get
them to take effect?

Thanks,
Chad Myers