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 Nicko Cadell <ni...@neoworks.com> on 2004/04/19 16:18:04 UTC
RE: Dynamic config: Changing log level of non-root logger
Chad,
Log4net should be picking up the changes to the logger levels when the
configuration file is reloaded.
Can you reproduce this issue with log4net internal logging enabled?
http://logging.apache.org/log4net/release/manual/faq.html#internalDebug
And post the output here.
Cheers,
Nicko
> -----Original Message-----
> From: Chad Myers [mailto:chad@chadmyers.com]
> Sent: 30 March 2004 18:11
> To: Log4NET User
> Subject: 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
>