关于log4.net 错误,求解
1、上结果
能生成文件 ,但是文件中无内容
2、配置文件
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<root>
<level value="ERROR"/>
<appender-ref ref="SysAppender"/>
</root>
<!-- Print only messages of level DEBUG or above in the packages -->
<logger name="WebLogger">
<level value="ERROR"/>
</logger>
<appender name="SysAppender" type="log4net.Appender.RollingFileAppender,log4net" >
<param name="File" value="App_Data/" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value=""Logs_"yyyyMMdd".txt"" />
<param name="StaticLogFileName" value="false" />
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
<param name="Header" value=" ----------------------header-------------------------- " />
<param name="Footer" value=" ----------------------footer-------------------------- " />
</layout>
</appender>
<appender name="consoleApp" type="log4net.Appender.ConsoleAppender,log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
</log4net>
3、log4、net选用
4求教 为什么有文件无内容。
本文来自博客园,作者:临时工~,转载请注明原文链接:https://www.cnblogs.com/jixinyu12345/p/6980383.html