-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlogback.xml
117 lines (85 loc) · 3.91 KB
/
logback.xml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!-- Logback Configuration. See http://logback.qos.ch/ -->
<configuration>
<property resource="log_dev_app.properties" />
<!-- Console (STDOUT) output. -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!-- Only print log messages at level WARN or higher. -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<!-- Default encoder is ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<!-- two-line layout suitable for a terminal -->
<pattern>%date{HH:mm:ss.SSS} %-5level %logger [%thread]%n%msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- The output file configuration for log/all.log -->
<appender name="ALL_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- Default encoder is ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%date{HH:mm:ss.SSS} %-5level %logger{25}: %msg %X thread=%thread%n</pattern>
</encoder>
<!-- Default location of log file is log/all.log -->
<file>log/all.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- Roll over log files daily -->
<fileNamePattern>log/all.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- And start a new file every 64 MB -->
<maxFileSize>64 MB</maxFileSize>
<!-- Keep at most 15 days of history -->
<maxHistory>15</maxHistory>
<!-- Up to a maximum of 512 MB -->
<totalSizeCap>512MB</totalSizeCap>
<!-- Ensure short-lived processes still clean up old logs -->
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
</appender>
<!-- The output file configuration for log/app.log -->
<appender name="APP_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- Default encoder is ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%date{HH:mm:ss.SSS} %-5level %logger{25}: %msg %X thread=%thread%n</pattern>
</encoder>
<!-- Default location of log file is log/app.log -->
<file>log/app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- Roll over log files daily -->
<fileNamePattern>log/app.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- And start a new file every 64 MB -->
<maxFileSize>64 MB</maxFileSize>
<!-- Keep at most 15 days of history -->
<maxHistory>15</maxHistory>
<!-- Up to a maximum of 512 MB -->
<totalSizeCap>512MB</totalSizeCap>
<!-- Ensure short-lived processes still clean up old logs -->
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
</appender>
<!-- Root log level is "ALL", meaning all log levels are emitted. -->
<root level="ALL">
<!-- Send all log messages to console (filtered to WARN) -->
<appender-ref ref="CONSOLE" />
<!-- Send all log messages to log/all.log -->
<appender-ref ref="ALL_LOG_FILE" />
</root>
<!-- Log messages from your application will be included in
log/all.log. In addition, we will send just messages from your
application to log/app.log -->
<logger name="${app_root_logger:-com.example.application}" level="ALL">
<appender-ref ref="APP_LOG_FILE" />
</logger>
<!-- If you have a REPL or interactive shell with a logger named
'user' or 'dev', send those messages to log/app.log too. -->
<logger name="user" level="ALL">
<appender-ref ref="APP_LOG_FILE" />
</logger>
<logger name="dev" level="ALL">
<appender-ref ref="APP_LOG_FILE" />
</logger>
<!-- Make java.util.logging more efficient at disabled levels.
See http://logback.qos.ch/manual/configuration.html#LevelChangePropagator -->
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
</configuration>