-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog4j2.xml
58 lines (52 loc) · 2.41 KB
/
log4j2.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
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="1800" status="WARN">
<Properties>
<Property name="LogLevel" value="${env:LogLevel:-INFO}"/>
<Property name="logBasePath" value="${sys:service.log.dir:-logs}"/>
</Properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
<RollingRandomAccessFile name="INFO" fileName="${logBasePath}/info.log"
filePattern="${logBasePath}/info.log.%d{yyyy-MM-dd}_%i.log"
bufferedIO="true" bufferSize="8192">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} - %-5p [%t] %m%n"/>
<filters>
<ThresholdFilter level="${LogLevel}" onMatch="NEUTRAL" onMismatch="DENY"/>
</filters>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" maxRandomDelay="60"/>
<SizeBasedTriggeringPolicy size="512 MB"/>
</Policies>
<DefaultRolloverStrategy max="9">
<Delete basePath="${logBasePath}" maxDepth="1">
<IfFileName glob="*info*"/>
<IfLastModified age="7d"/>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="ERROR" fileName="${logBasePath}/error.log"
filePattern="${logBasePath}/error.log.%d{yyyy-MM-dd}.log"
bufferedIO="true" bufferSize="8192">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} - %-5p [%t] %m%n"/>
<filters>
<ThresholdFilter level="ERROR" onMatch="NEUTRAL" onMismatch="DENY"/>
</filters>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" maxRandomDelay="60"/>
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="${logBasePath}" maxDepth="1">
<IfFileName glob="*"/>
<IfLastModified age="7d"/>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>