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).RemoveAppender(appende
rName);
}

public static void RemoveAllAppendes(log4net.ILog log)
{
 
((log4net.Repository.Hierarchy.Logger)log.Logger).RemoveAllAppenders();
}

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