-
Notifications
You must be signed in to change notification settings - Fork 27
/
log4net.config
33 lines (31 loc) · 1.38 KB
/
log4net.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<!--按日期分割的appender-->
<appender name="LogFileAppenderByDate" type="log4net.Appender.RollingFileAppender" >
<param name="AppendToFile" value="true" />
<!--是否续写-->
<param name="LockingModel" value="log4net.Appender.FileAppender.MinimalLock" />
<!--最小锁定模型以允许多个进程可以写入同一个文件-->
<param name="StaticLogFileName" value="true" />
<param name="File" value="Log\\" />
<!--保存路径-->
<param name="DatePattern" value="yyyy-MM-dd.TXT" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Date" />
<param name="MaxFileSize" value="102400000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date ID:[%thread] %logger ~~ %-5level ~~ %message%newline" />
<!--输出格式-->
</layout>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
</appender>
<root>
<appender-ref ref="LogFileAppenderByDate" />
<level value="ALL"></level>--><!--控制级别,由低到高: ALL|DEBUG|INFO|WARN|ERROR|FATAL|OFF-->
</root>
</log4net>
</configuration>