首页新闻找找看学习计划

log4net:no appender names rollinglogfileappender

0
[已关闭问题] 关闭于 2016-07-28 10:09

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="DebugLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\WS-Debug-" />
<param name="StaticLogFileName" value="false"/>
<appendToFile value="true" />
<datePattern value="yyyy-MM-dd&quot;.log&quot;" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMax value="DEBUG"/>
<levelMin value="DEBUG"/>
</filter>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%date[%thread]%-5level % logger[%property{NDC}] - %message%newline"/>
</layout>
</appender>

<appender name="ErrorLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\WS-Error-" />
<param name="StaticLogFileName" value="false"/>
<appendToFile value="true" />
<datePattern value="yyyy-MM-dd&quot;.log&quot;" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMax value="ERROR"/>
<levelMin value="ERROR"/>
</filter>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%message%newline"/>
</layout>
</appender>

<appender name="InfoLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\WS-Info-" />
<param name="StaticLogFileName" value="false"/>
<appendToFile value="true" />
<datePattern value="yyyy-MM-dd&quot;.log&quot;" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMax value="INFO"/>
<levelMin value="INFO"/>
</filter>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%message%newline"/>
</layout>
</appender>

<appender name="WarnLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\WS-Warn-" />
<param name="StaticLogFileName" value="false"/>
<appendToFile value="true" />
<datePattern value="yyyy-MM-dd&quot;.log&quot;" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMax value="WARN"/>
<levelMin value="WARN"/>
</filter>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%message%newline"/>
</layout>
</appender>

<appender name="FatalLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\WS-Fatal-" />
<param name="StaticLogFileName" value="false"/>
<appendToFile value="true" />
<datePattern value="yyyy-MM-dd&quot;.log&quot;" />
<filter type="log4net.Filter.LevelRangeFilter">
<levelMax value="FATAL"/>
<levelMin value="FATAL"/>
</filter>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%date[%thread]%-5level % logger[%property{NDC}] - %message%newline"/>
</layout>
</appender>


<root>
<level value="ALL"/>
<appender-ref ref="DebugLogFileAppender"/>
<appender-ref ref="ErrorLogFileAppender"/>
<appender-ref ref="InfoLogFileAppender"/>
<appender-ref ref="WarnLogFileAppender"/>
<appender-ref ref="FatalLogFileAppender"/>
</root>
<logger name="Telewave.LogManager">
<level value="ALL"/>
<appender-ref ref="RollingLogFileAppender"/>
</logger>
<logger name="AppLog">
<level value="ALL" />
<appender-ref ref="InfoLogFileAppender" />
</logger>

</log4net>
</configuration>

 

 

 

这个配置我在WINFORM下使用正常啊 为啥在控制台应用程序使用 就报错

log4net:error xmlhierarchyconfigurator:no appender names rollinglogfileappender

Dellienware的主页 Dellienware | 初学一级 | 园豆:39
提问于:2016-04-26 09:58
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册