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.
29 lines
1.2 KiB
29 lines
1.2 KiB
<?xml version="1.0" encoding="utf-8" ?>
|
|
<configuration>
|
|
<configSections>
|
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
|
</configSections>
|
|
<log4net>
|
|
<root>
|
|
<level value="Info" />
|
|
<!--文件形式记录日志-->
|
|
<appender-ref ref="RollingLogFileAppender" />
|
|
</root>
|
|
<!--定义输出到文件中-->
|
|
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
|
|
<param name="File" value="logs/" />
|
|
<param name="Encoding" value="UTF-8" />
|
|
<param name="RollingStyle" value="Date" />
|
|
<param name="DatePattern" value="yyyy-MM-dd'.txt'" />
|
|
<param name="LockingModel" type="log4net.Appender.FileAppender+MinimalLock" />
|
|
<param name="AppendToFile" value="true" />
|
|
<param name="StaticLogFileName" value="false" />
|
|
<param name="MaxSizeRollBackups" value="30" />
|
|
<param name="maximumFileSize" value="5MB" />
|
|
<layout type="log4net.Layout.PatternLayout">
|
|
<!--输出格式-->
|
|
<conversionPattern value="【日志级别】%-5level 【记录时间】%date 【线程编号】[%thread]【执行时间】[%r]毫秒 【当前的类】%logger 属性[%property{NDC}]%n【日志描述】%message%n%n" />
|
|
</layout>
|
|
</appender>
|
|
</log4net>
|
|
</configuration>
|