logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Bigham <dbig...@navtechinc.com>
Subject Chained loggers
Date Wed, 01 Oct 2008 21:27:03 GMT
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


Mime
View raw message