-
Notifications
You must be signed in to change notification settings - Fork 1
/
log4j2.xml
52 lines (52 loc) · 2.62 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
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="30" status="warn">
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="%style{%d}{bright,blue} %highlight{%-5p}%highlight{ %c{1.} [%t] %m%n%rEx}{FATAL=bright red, ERROR=bright red, WARN=bright yellow, INFO=Normal, DEBUG=Normal, TRACE=Normal}"/>
</Console>
<RollingRandomAccessFile name="FILE"
fileName="logs/base.log"
filePattern="./logs/base-%d{yyyy-MM-dd}-%i.log.gz"
immediateFlush="false">
<PatternLayout charset="UTF-8">
<Pattern>%d %-5p %c{1.} [%t] %m%n%rEx</Pattern>
</PatternLayout>
<Policies>
<!--<OnStartupTriggeringPolicy/>-->
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="1000 MB"/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
<Routing name="ROUTER">
<Routes pattern="$${marker:}">
<Route ref="FILE" key="$${marker:}"/> <!-- ${marker:} pattern remains unchangeed if marker was null, so we match literally here to handle default case -->
<Route> <!-- default route e.g. when marker is non-null -->
<RollingRandomAccessFile name="${marker:}"
fileName="logs/host-${marker:}.log"
filePattern="./logs/host-${marker:}-%d{yyyy-MM-dd}-%i.log.gz"
immediateFlush="false">
<PatternLayout charset="UTF-8">
<Pattern>%d %-5p %c{1.} [%t] %m%n%rEx</Pattern>
</PatternLayout>
<Policies>
<!--<OnStartupTriggeringPolicy/>-->
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="1000 MB"/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
</Route>
</Routes>
<IdlePurgePolicy timeToLive="1" timeUnit="days"/>
</Routing>
</Appenders>
<Loggers>
<AsyncLogger name="io.nitor" level="trace"/>
<AsyncLogger name="org.otherone" level="trace"/>
<AsyncRoot level="trace">
<AppenderRef ref="CONSOLE"/>
<AppenderRef ref="ROUTER"/>
</AsyncRoot>
</Loggers>
</Configuration>