logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: filtering on message source
Date Tue, 06 Dec 2005 04:23:59 GMT
It sounds like you need to write a custom filter that looks like this:

 <filter type="Company.Project.Logging.CustomFilter">
  <logLevelEqualOrAbove level="WARN" />
  <allMessagesFromLogger name="Company.Project.UI.Login" />
  <allMessagesFromLogger name="Company.Project.UI.Logout" />
 </filter>

That would accept all messages from Login and Logout and only those
messages from other loggers that are WARN or above.

Is that correct?

--- "Dalton, Barnaby" <Barnaby.Dalton@brevanhoward.com> wrote:

> 
> I need to combine messages from one class with messages of level WARN
> or
> above from other classes. I can easily log the WARN and above
> messages
> but was wondering on the best way to add in ALL messages from the
> specific class. Is the best technique to define a second logger and
> then
> use LoggerMatchFilter in the appender? Can I avoid having to define a
> second logger and use some kind of ClassSource filter?
> 
> Thanks
> Barney
> 
> 
> 


Mime
View raw message