Thanks! This works nicely. Irene
-----Original Message----- From: Nicko Cadell [mailto:[EMAIL PROTECTED] Sent: Monday, April 24, 2006 12:20 PM To: Log4NET User Subject: RE: Interface method to request the level of a Logger? Using just Level gives the actual value set on the logger via configuration. If the logger has not had an explicit level set on it then it will inherit the value from its parent. Use the EffectiveLevel property to get the currently applied level value, this is what IsEnabledFor(Level) uses. ((log4net.Repository.Hierarchy.Logger)(log.Logger)).EffectiveLevel > -----Original Message----- > From: Irene Altdorf [mailto:[EMAIL PROTECTED] > Sent: 24 April 2006 14:41 > To: 'Log4NET User' > Subject: RE: Interface method to request the level of a Logger? > > Thanks for your quick response, Nicko. > > I tried this, but even though the logger level was error (I > tested 'log.IsErrorEnabled' just before the code you > suggested), the line below had 'null' for the level. Would > there be a way around this? > > Thanks again, > Irene > > -----Original Message----- > From: Nicko Cadell [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 23, 2006 6:17 PM > To: Log4NET User > Subject: RE: Interface method to request the level of a Logger? > > Try: > > ((log4net.Repository.Hierarchy.Logger)(log.Logger)).Level > > Nicko > > > -----Original Message----- > > From: Irene Altdorf [mailto:[EMAIL PROTECTED] > > Sent: 23 April 2006 22:13 > > To: [email protected] > > Subject: Interface method to request the level of a Logger? > > > > Hello, > > > > > > > > Is there an interface method to get the current level of a Logger? > > Using the ILog interface, I can determine whether certain > levels are > > enabled via the IsxxxEnabled property, but I was hoping to > be able to > > make one call to get the current Logger level. It might > seem like an > > odd request, but we will be passing that info on to a lower level > > component. > > > > > > > > Sorry if I have missed something obvious. > > > > > > > > Thanks, > > > > Irene > > > > > > > > > > > >
