Ensure that Log4J is shutdown when stopping the server (Fixes #7932)

This commit is contained in:
Shane Freeder 2022-06-12 01:59:24 +01:00
parent c044b14efd
commit 6c52b5e2c8
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
1 changed files with 4 additions and 3 deletions

View File

@ -71,7 +71,7 @@ index 8cc4cb2163a93b9491550fe6d0f5d980fb216920..4dd14d73a37b32288a64fbd67ee22c43
cause = cause.getCause(); cause = cause.getCause();
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 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 --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/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<TickTa @@ -281,7 +281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -451,10 +451,10 @@ index fea479165e4cf1e4fc6e462d63123bf31bb4e3c3..5e79ad04aed13462d1d187a71801aeb2
private static List<String> asList(String... params) { private static List<String> asList(String... params) {
return Arrays.asList(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 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 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
+++ b/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 @Override
public void run() { public void run() {
try { try {
@ -477,6 +477,7 @@ index b4a19d80bbf71591f25729fd0e98590350cb31d0..d752720f2f234b9dbd2117333fee1bfa
+ e.printStackTrace(); + e.printStackTrace();
+ // Paper end + // Paper end
} finally { } finally {
+ org.apache.logging.log4j.LogManager.shutdown(); // Paper
try { try {
- net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender - net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender
+ //net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Move into stop + //net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Move into stop