-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom-log4j2.xml
64 lines (52 loc) · 1.99 KB
/
custom-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
59
60
61
62
63
64
<?xml version="1.0" encoding="UTF-8"?>
<!-- log4j2.xml - Example log4j configuration file
Place this file in the same directory as your server.jar, edit
to taste, and add -Dlog4j.configurationFile=log4j2.xml to your
server startup flags.
More log4j example configs can be found at
<http://logging.apache.org/log4j/2.x/manual/appenders.html>.
-->
<Configuration status="WARN" packages="net.minecraft,com.mojang">
<Appenders>
<!-- DEFAULT APPENDERS -->
<!-- console logging - logs to stdout -->
<Console name="SysOut" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n" />
</Console>
<!-- GUI logging - ignored if you use `java -jar server.jar nogui` -->
<Queue name="ServerGuiConsole">
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss} %level]: %msg%n" />
</Queue>
<!-- file logging - stuff under the logs/ dir -->
<RollingRandomAccessFile name="File" fileName="logs/latest.log"
filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
<!-- <SizeBasedTriggeringPolicy size="250 MB"/> -->
</Policies>
<!-- keep up to 20 files before removing them -->
<!-- <DefaultRolloverStrategy max="20"/> -->
</RollingRandomAccessFile>
<!-- EXAMPLE APPENDERS -->
<!-- legacy logging - logs to server.log -->
<File name="LegacyServerLog" fileName="server.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n" />
</File>
</Appenders>
<Loggers>
<Root level="info">
<!-- DEFAULT LOGGERS -->
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY"
onMismatch="NEUTRAL" />
</filters>
<AppenderRef ref="SysOut"/>
<AppenderRef ref="File"/>
<AppenderRef ref="ServerGuiConsole"/>
<!-- EXAMPLE LOGGERS -->
<!-- <AppenderRef ref="LegacyServerLog"/> -->
</Root>
</Loggers>
</Configuration>