Update Log4J Configuration file to stop truncating stack traces

This should help greatly (as long as this change works...) in
understanding an exception when it doesn't get truncated with
"... and 14 more" at a vital point of the stack trace.
This commit is contained in:
Aikar 2020-05-22 23:49:10 -04:00
parent 5978d3cdd8
commit 78d38c0d3c

View File

@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net> From: Minecrell <minecrell@minecrell.net>
Date: Sat, 23 Sep 2017 21:07:20 +0200 Date: Sat, 23 Sep 2017 21:07:20 +0200
Subject: [PATCH] Disable logger prefix for various plugins bypassing the Subject: [PATCH] Improve Log4J Configuration / Plugin Loggers
plugin logger
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 Some plugins bypass the plugin logger and add the plugin prefix
manually to the log message. Since they use other logger names manually to the log message. Since they use other logger names
@ -15,22 +18,30 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/resources/log4j2.xml --- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
</Queue>
<TerminalConsole name="TerminalConsole">
<PatternLayout> <PatternLayout>
<LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx}"> - <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx}">
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx{full}}">
<!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix --> <!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
- <PatternMatch key=",net.minecraft.,Minecraft,com.mojang." - <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
- pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
+ <!-- Disable prefix for various plugins that bypass the plugin logger --> + <!-- Disable prefix for various plugins that bypass the plugin logger -->
+ <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE" + <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" /> + pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx{full}}" />
</LoggerNamePatternSelector> </LoggerNamePatternSelector>
</PatternLayout> </PatternLayout>
@@ -0,0 +0,0 @@ </TerminalConsole>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout> <PatternLayout>
<LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n"> - <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n">
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n%xEx{full}">
<!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix --> <!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
- <PatternMatch key=",net.minecraft.,Minecraft,com.mojang." - <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
- pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
+ <!-- Disable prefix for various plugins that bypass the plugin logger --> + <!-- Disable prefix for various plugins that bypass the plugin logger -->
+ <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE" + <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" /> + pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n%xEx{full}" />
</LoggerNamePatternSelector> </LoggerNamePatternSelector>
</PatternLayout> </PatternLayout>
<Policies>