-
Notifications
You must be signed in to change notification settings - Fork 5
/
log4net.config
54 lines (49 loc) · 1.51 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<log4net>
<appender name="ColoredConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss} [%thread] %-5level: %message - %logger{1}%newline" />
</layout>
<mapping>
<level value="FATAL" />
<foreColor value="Red" />
</mapping>
<mapping>
<level value="ERROR" />
<foreColor value="Red" />
</mapping>
<mapping>
<level value="WARN" />
<foreColor value="Yellow" />
</mapping>
<mapping>
<level value="INFO" />
<foreColor value="White" />
</mapping>
<mapping>
<level value="DEBUG" />
<foreColor value="DarkGray" />
</mapping>
</appender>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="${ProgramData}\SampleWebApp.log" />
<encoding value="utf-8" />
<appendToFile value="false" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="5" />
<maximumFileSize value="5MB" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline%exception" />
</layout>
</appender>
<logger name="System">
<level value="INFO"></level>
</logger>
<logger name="Microsoft">
<level value="INFO"></level>
</logger>
<root>
<level value="TRACE" />
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="ColoredConsoleAppender" />
</root>
</log4net>