Tuesday, 14 October 2008

Filtering log4net messages

I can never remember how to do this: filter out logging message based on where they come from.

The solution is to use a LoggerMatchFilter. The code below can be inserted into any appender definition:

<filter type="log4net.Filter.LoggerMatchFilter">
<loggertomatch value="NHibernate.Loader.Loader"/>
<acceptonmatch value="false"/>
</filter>

No comments: