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.

32 lines
1.3 KiB

7 months ago
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- 控制台日志配置 -->
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<!-- 日志输出格式 -->
<layout type="log4net.Layout.PatternLayout">
7 months ago
<conversionPattern value="%date %5level [%thread] (%file:%line) - %message%newline"/>
7 months ago
</layout>
</appender>
<!-- 文件存储日志配置 -->
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<!-- 保存文件的名称 -->
7 months ago
<file value="logs\Console.log"/>
<appendToFile value="true"/>
7 months ago
<!-- 文件的编码方式 -->
<param name="Encoding" value="UTF-8"/>
<!-- 每个文件的大小 -->
7 months ago
<maximumFileSize value="100MB"/>
7 months ago
<!-- 保存文件数量 -->
7 months ago
<maxSizeRollBackups value="2"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
7 months ago
<!-- 日志输出格式 -->
<layout type="log4net.Layout.PatternLayout">
7 months ago
<conversionPattern value="%date %level %thread %logger - %message%newline"/>
7 months ago
</layout>
</appender>
<root>
7 months ago
<level value="ALL"/>
<appender-ref ref="Console"/>
<appender-ref ref="RollingFile"/>
7 months ago
</root>
</log4net>