7
我想,當我做下面logger.Warn什麼寫Console.Out,然後我想寫信給Console.Err當我登錄任何logger.Error以上。我將如何編寫我的log4net配置文件?如何將log4net consoleappender配置爲基於Level寫入Console.Err和Console.Out?
到目前爲止,我有:
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
爲什麼-1投票? – Denis