aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch
blob: 4f654facd6c8c1429566e5a2138c2553e8b1692f (plain)
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
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Sat, 23 Sep 2017 21:07:20 +0200
Subject: [PATCH] Improve Log4J Configuration / Plugin Loggers

Add full exceptions to log4j to not truncate stack traces

Disable logger prefix for various plugins bypassing the plugin logger

Some plugins bypass the plugin logger and add the plugin prefix
manually to the log message. Since they use other logger names
(e.g. qualified class names) these would now also appear in the
log. Disable the logger prefix for these plugins so the messages
show up correctly.

diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
index e073707a46397f62bedf1d413f9e5764e77dda6a..ab1caec640128aa90f246e4bbecf5ca275e7982e 100644
--- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml
@@ -6,19 +6,21 @@
         </Queue>
         <TerminalConsole name="TerminalConsole">
             <PatternLayout>
-                <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %msg%n%xEx}">
+                <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %msg%n%xEx{full}}">
                     <!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
-                    <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
-                                  pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx}" />
+                    <!-- Disable prefix for various plugins that bypass the plugin logger -->
+                    <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
+                                  pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx{full}}" />
                 </LoggerNamePatternSelector>
             </PatternLayout>
         </TerminalConsole>
         <RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
             <PatternLayout>
-                <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %stripAnsi{%msg}%n">
+                <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %stripAnsi{%msg}%n%xEx{full}">
                     <!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
-                    <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
-                                  pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n" />
+                    <!-- Disable prefix for various plugins that bypass the plugin logger -->
+                    <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
+                                  pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n%xEx{full}" />
                 </LoggerNamePatternSelector>
             </PatternLayout>
             <Policies>