You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

61 lines
2.7 KiB

<log4net>
<!-- 错误日志类-->
<logger name="Error">
<level value="ALL" />
<appender-ref ref="ErrorAppender" />
</logger>
<!-- 信息日志类 -->
<logger name="Info">
<level value="ALL" />
<appender-ref ref="InfoAppender" />
</logger>
<!-- 信息日志类 -->
<logger name="Debug">
<level value="ALL" />
<appender-ref ref="DebugAppender" />
</logger>
<!-- 错误日志附加介质-->
<appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\Error\\" />
<param name="AppendToFile" value="true" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
<param name="RollingStyle" value="Date" />
<!--布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n【异常时间】:%d [%t] &lt;BR&gt;%n【异常级别】:%-5p &lt;BR&gt;%n【异 常 类】:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
<!-- 错误日志附加介质-->
<appender name="DebugAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\Debug\\" />
<param name="AppendToFile" value="false" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
<param name="RollingStyle" value="Date" />
<!--布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n【调试时间】:%d [%t] &lt;BR&gt;%n【调试级别】:%-5p &lt;BR&gt;%n【异 常 类】:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
<!-- 信息日志附加介质-->
<appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\Info\\" />
<param name="AppendToFile" value="false" />
<param name="MaxFileSize" value="1" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
<param name="RollingStyle" value="Date" />
<!-- 信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=blue&gt;%n日志时间:%d [%t] &lt;BR&gt;%n日志级别:%-5p &lt;BR&gt;%n日 志 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
</log4net>