Andrew,

The Hierarchy.Root.Level is the level for the root logger. This level is
inherited by all child loggers in the hierarchy unless they override it.

For details see the Level Inheritance section of the manual at:
http://logging.apache.org/log4net/release/manual/introduction.html#HC-52
37022

The Hierarchy.Threshold is the threshold level for the whole hierarchy,
this takes precedence over the Levels set on the loggers. This is
typically used only to turn logging on and off for the whole hierarchy.

Nicko

> -----Original Message-----
> From: Andrew Elmhorst [mailto:[EMAIL PROTECTED] 
> Sent: 20 October 2004 21:02
> To: 'Log4NET User'
> Subject: RE: Problems upgrading to version 1.2 from 1.1
> 
> Thanks for the insight! I think that helps a lot. I do have 
> one further question . . .
> 
> What is the difference between setting the 
> Hierarchy.Threshold and setting Hierarchy.Root.Level? It 
> appears to me that they both filter the log messages at a 
> global level. Does one take precendence over the other?
> 
> 
> Regards,
> 
> Andrew Elmhorst
> 
> 
> 
> -----Original Message-----
> From: Nicko Cadell [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 20, 2004 1:56 PM
> To: Log4NET User
> Subject: RE: Problems upgrading to version 1.2 from 1.1
> 
> The ILog is just an adapter. To change the configuration you 
> need to get its Logger property (the object that does the 
> real work) and then you need to cast it to the right type. 
> The following methods should do the
> job:
> 
> 
> public static void RemoveAppender(log4net.ILog log, string 
> appenderName) {
>  
> ((log4net.Repository.Hierarchy.Logger)log.Logger).RemoveAppend
> er(appende
> rName);
> }
> 
> public static void RemoveAllAppendes(log4net.ILog log) {
>  
> ((log4net.Repository.Hierarchy.Logger)log.Logger).RemoveAllApp
> enders();
> }
> 
> public static void AddAppender(log4net.ILog log, 
> log4net.Appender.IAppender appender) {
>  
> ((log4net.Repository.Hierarchy.Logger)log.Logger).AddAppender(
> appender);
> }
> 
> public static void SetLevel(log4net.ILog log, 
> log4net.spi.Level level) {
>   ((log4net.Repository.Hierarchy.Logger)log.Logger).Level = level; }
> 
> Nicko 
> 
> 
> 

Reply via email to