If you want to allow only INFO events then you would use

<filter type="log4net.Filter.LevelMatchFilter">
  <levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter">

if you want to opposite effect, i.e. all events except INFO, they you
can use:

<filter type="log4net.Filter.LevelMatchFilter">
  <levelToMatch value="INFO" />
  <acceptOnMatch value="false" />
</filter>

Here the filter will Deny the INFO events and pass on the other events,
and without the DenyAllFilter these will be logged.

Essentially you have a chain of filters and you need to decide if you
want the filters to explicitly accept events or explicitly deny events,
then decide what to do with the remaining events - either accept them
all (the default) or deny them all (with the DenyAllFilter).

Nicko

> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
> Sent: 14 June 2005 19:07
> To: Log4NET User
> Subject: Re: Info Only Appender
> 
> After reading the SDK docs for FilterSkeleton and 
> LevelMatchFilter, I didn't think I needed to put the 
> DenyAllFilter at the end of the filter chain. The website 
> gave a clearer explaination of what its necessary.
> It seems like a good recemendation would be to always include 
> a DenyAllFilter at the end of the filter chain. Is that 
> generally the case Nicko?
> 
> --- Ron Grabowski <[EMAIL PROTECTED]> wrote:
> 
> > 1)
> > 
> >  <appender name="SystemLog" type="log4net.Appender.FileAppender">
> >  <filter type="log4net.Filter.LevelMatchFilter">
> >   <levelToMatch value="INFO" />
> >  </filter>
> >  ...
> >  </appender>
> 

Reply via email to