From 6c52b5e2c8d193d6ef890b6b759a3a38d1f08ab7 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 12 Jun 2022 01:59:24 +0100 Subject: [PATCH] Ensure that Log4J is shutdown when stopping the server (Fixes #7932) --- patches/server/0384-Improved-Watchdog-Support.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/server/0384-Improved-Watchdog-Support.patch b/patches/server/0384-Improved-Watchdog-Support.patch index 5be4dd65b..00fb07603 100644 --- a/patches/server/0384-Improved-Watchdog-Support.patch +++ b/patches/server/0384-Improved-Watchdog-Support.patch @@ -71,7 +71,7 @@ index 8cc4cb2163a93b9491550fe6d0f5d980fb216920..4dd14d73a37b32288a64fbd67ee22c43 cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f69ed252f55623ee5cba6ac9d28096c2cc92ea04..691fbbb720a3a58aa4e0daee715e9ce36d37ec4c 100644 +index ce7b96819bf8d7e992c2aafd3013e8a9478e500d..e055824c5414e3b723fbc2ba41e01fda96b72901 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -281,7 +281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop asList(String... params) { return Arrays.asList(params); diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index b4a19d80bbf71591f25729fd0e98590350cb31d0..d752720f2f234b9dbd2117333fee1bfad663ec02 100644 +index b4a19d80bbf71591f25729fd0e98590350cb31d0..e948ec5a573b22645664eb53bc3e9932246544e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -@@ -12,12 +12,27 @@ public class ServerShutdownThread extends Thread { +@@ -12,12 +12,28 @@ public class ServerShutdownThread extends Thread { @Override public void run() { try { @@ -477,6 +477,7 @@ index b4a19d80bbf71591f25729fd0e98590350cb31d0..d752720f2f234b9dbd2117333fee1bfa + e.printStackTrace(); + // Paper end } finally { ++ org.apache.logging.log4j.LogManager.shutdown(); // Paper try { - net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender + //net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Move into stop