You can only have one logger entry per logger. The way to accomplish
this would be to attach both appenders to the same logger and then set a
LevelRangefilter to one or both of the appenders.

This will accomplish the example you gave:

        <appender name="Appender1" ...>
                ...
        </appender>
        
        <appender name="Appender2" ...>
                ...
                <filter type="log4net.Filter.LevelRangeFilter">
                        <levelMin value="ERROR" />
                        <levelMax value="OFF" />
                </filter>
        </appender>
        
        <logger name="Logger1">
                <level value="ALL">
                <appender-ref ref="Appender1"/>
                <appender-ref ref="Appender2"/>
        </logger>

This answer and more can be learned just by reading the configuration
page.

John VanderKolk


The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.

From: Dan Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 1:08 PM
To: [email protected]
Subject: configuration file question 

Hi,

Read through the docs and couldn't find the answer...

1. Let's say I have 2 appenders, and I want to have the same logger send

different levels to different appenders, but it does not appear to work,

nothing is going through.  Is this possible?  If not, is there another 
way to accomplish this?  I was considering putting it as a filter on the

appender, but I would like other loggers at different levels go to that 
appender, so that won't work.

        <logger name="Logger1">
            <level value="All" />
            <appender-ref ref="Appender1"  />
        </logger>

        <logger name="Logger1">
            <level value="ERROR" />
            <appender-ref ref="Appender2"  />
        </logger>

Thanks,

Dan

Reply via email to