Controlling log4net output

If you've used log4net before, you know it's a simple and easy way to add some pretty powerful logging capabilities to your application. I recently had log4net configured to log to both a text file and the console. I had the logging level configured for all messages, but I didn't want everything going to the console. After some digging through the docs I found out that you can add the "Threshold" parameter to an appender to control the logging level for a single appender:

<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
    <param name="Threshold" value="INFO" />
    <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
    </layout>
</appender>

Blogged so I don't forget it! :)

No Comments