<?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".log"" />
<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".log"" />
<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".log"" />
<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".log"" />
<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".log"" />
<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
我也是 这个问题