You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Daniel Bigham <db...@navtechinc.com> on 2008/10/01 23:27:03 UTC

Chained loggers

Hi,

I'm trying to create a chained logger according to the following logic:

if ( condition1 == true && condition2 == true )
{
 accept
}

How can this be specified in XML?

Here is what I have tried:

<appender name="SupportToolAppender"
             type="log4net.Appender.AdoNetAppender">
     <filter type="log4net.Filter.PropertyFilter">
       <acceptOnMatch value="false" />
       <key value="eventid" />
       <regexToMatch value="\d+" />
       <next type="log4net.Filter.LevelRangeFilter">                  
<acceptOnMatch value="true" />
         <levelMin value="INFO" />
         <levelMax value="FATAL" />
       </next>
     </filter>
     <filter type="log4net.Filter.DenyAllFilter" />
     ...
</appender>

I guess more specifically my question is how the "next" property can be 
used to define the next logger in the chain. The above doesn't seem to 
work. I've tried some other things such as:

<next>
 <filter ...>
   ...
 </filter>
</next>

... but that doesn't work either.

I don't see any documentation on the log4net site that explains how this 
is to be done, and Googling it hasn't helped much either.

Thanks,
Daniel

-- 
Daniel Bigham
Software Developer

Navtech, Inc.
295 Hagey Blvd., Suite 200
Waterloo, Ontario, N2L 6R5
tel: (519) 747 1170 x.301
fax: (519) 747-1003
dbigham@navtechinc.com

-- 
Daniel Bigham
Software Developer
 
Navtech, Inc.
295 Hagey Blvd., Suite 200
Waterloo, Ontario, N2L 6R5
tel: (519) 747 1170 x.301
fax: (519) 747-1003
dbigham@navtechinc.com