This repository has been archived by the owner on May 13, 2024. It is now read-only.
forked from PaperMC/Waterfall
-
Notifications
You must be signed in to change notification settings - Fork 2
/
0037-Add-Log4j-configuration-that-replicates-the-old-Bung.patch
51 lines (48 loc) · 2.22 KB
/
0037-Add-Log4j-configuration-that-replicates-the-old-Bung.patch
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
From 27d38f7079c9069b6568d6d7042d8e2e1422afea Mon Sep 17 00:00:00 2001
From: Minecrell <[email protected]>
Date: Sun, 24 Sep 2017 12:06:49 +0200
Subject: [PATCH] Add Log4j configuration that replicates the old BungeeCord
setup
Can be enabled using -Dlog4j.configurationFile=log4j2-bungee.xml.
diff --git a/log4j/src/main/resources/log4j2-bungee.xml b/log4j/src/main/resources/log4j2-bungee.xml
new file mode 100644
index 00000000..6e9c09c5
--- /dev/null
+++ b/log4j/src/main/resources/log4j2-bungee.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Log4j configuration that replicates the old BungeeCord logging setup -->
+<Configuration status="warn">
+ <Appenders>
+ <TerminalConsole name="TerminalConsole">
+ <PatternLayout>
+ <LoggerNamePatternSelector defaultPattern="%highlightError{%d{HH:mm:ss} [%level] [%logger] %minecraftFormatting{%msg}%n%ex}">
+ <!-- Log root and BungeeCord loggers without prefix -->
+ <PatternMatch key=",BungeeCord" pattern="%highlightError{%d{HH:mm:ss} [%level] %minecraftFormatting{%msg}%n%ex}" />
+ </LoggerNamePatternSelector>
+ </PatternLayout>
+ </TerminalConsole>
+ <RollingRandomAccessFile name="File" fileName="proxy.log.0" filePattern="proxy.log.%i" immediateFlush="false">
+ <PatternLayout>
+ <LoggerNamePatternSelector defaultPattern="%d{HH:mm:ss} [%level] [%logger] %minecraftFormatting{%msg}{strip}%n%ex">
+ <!-- Log root and BungeeCord loggers without prefix -->
+ <PatternMatch key=",BungeeCord" pattern="%d{HH:mm:ss} [%level] %minecraftFormatting{%msg}{strip}%n%ex" />
+ </LoggerNamePatternSelector>
+ </PatternLayout>
+ <Policies>
+ <OnStartupTriggeringPolicy />
+ <SizeBasedTriggeringPolicy size="8 MB" />
+ </Policies>
+ <DefaultRolloverStrategy fileIndex="min" max="8" />
+ </RollingRandomAccessFile>
+ </Appenders>
+
+ <Loggers>
+ <Root level="info">
+ <AppenderRef ref="TerminalConsole" />
+ <AppenderRef ref="File" />
+ </Root>
+ </Loggers>
+</Configuration>
--
2.42.0