-
Notifications
You must be signed in to change notification settings - Fork 3
/
log4j2.xml
51 lines (44 loc) · 2.33 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
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<!-- System out -->
<Console name="SysOut" target="SYSTEM_OUT">
<PatternLayout pattern="%style{[%d{HH:mm:ss}]}{blue} %highlight{[%t/%level]}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=green, TRACE=blue} %style{(%logger{1})}{cyan} %highlight{%msg{nolookups}%n%ex{full}}{FATAL=red, ERROR=red, WARN=normal, INFO=normal, DEBUG=normal, TRACE=normal}" disableAnsi="${sys:fabric.log.disableAnsi:-true}" />
</Console>
<!-- Vanilla server gui -->
<Queue name="ServerGuiConsole" ignoreExceptions="true">
<PatternLayout>
<LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss} %level] (%logger{1}) %msg{nolookups}%n">
<!-- Dont show the logger name for minecraft classes-->
<PatternMatch key="net.minecraft.,com.mojang." pattern="[%d{HH:mm:ss} %level] %msg{nolookups}%n"/>
</LoggerNamePatternSelector>
</PatternLayout>
</Queue>
<!-- latest.log same as vanilla -->
<RollingRandomAccessFile name="LatestFile" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] (%logger{1}) %msg{nolookups}%n%ex" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
</Policies>
</RollingRandomAccessFile>
<!-- Debug log file -->
<RollingRandomAccessFile name="DebugFile" fileName="logs/debug.log" filePattern="logs/debug-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] (%logger) %msg{nolookups}%n%ex" />
<!-- Keep 5 files max -->
<DefaultRolloverStrategy max="5" fileIndex="min"/>
<Policies>
<SizeBasedTriggeringPolicy size="200MB"/>
<OnStartupTriggeringPolicy />
</Policies>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="DebugFile" level="debug"/>
<AppenderRef ref="SysOut" level="info"/>
<AppenderRef ref="LatestFile" level="info"/>
<AppenderRef ref="ServerGuiConsole" level="info"/>
</Root>
</Loggers>
</Configuration>