2022-08-21 04:57:17 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Moreno?= <josemmo@pm.me>
|
|
|
|
Date: Sat, 5 Jun 2021 13:45:15 +0200
|
|
|
|
Subject: [PATCH] Fix plugin loggers on server shutdown
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/log/CustomLogManager.java b/src/main/java/io/papermc/paper/log/CustomLogManager.java
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dcd79602dc
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/io/papermc/paper/log/CustomLogManager.java
|
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
+package io.papermc.paper.log;
|
|
|
|
+
|
|
|
|
+import java.util.logging.LogManager;
|
|
|
|
+
|
|
|
|
+public class CustomLogManager extends LogManager {
|
|
|
|
+ private static CustomLogManager instance;
|
|
|
|
+
|
|
|
|
+ public CustomLogManager() {
|
|
|
|
+ instance = this;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void reset() {
|
|
|
|
+ // Ignore calls to this method
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void superReset() {
|
|
|
|
+ super.reset();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void forceReset() {
|
|
|
|
+ if (instance != null) {
|
|
|
|
+ instance.superReset();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2023-03-27 19:19:23 +02:00
|
|
|
index 682005e4b19ba3959d4e3a66475487daf534a003..fbc06f45926e9073c95c97423f92a213898fcd48 100644
|
2022-08-21 04:57:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2023-03-27 19:19:23 +02:00
|
|
|
@@ -1001,6 +1001,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2022-08-21 04:57:17 +02:00
|
|
|
net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender
|
|
|
|
} catch (Exception e) {
|
|
|
|
}
|
|
|
|
+ io.papermc.paper.log.CustomLogManager.forceReset(); // Paper - Reset loggers after shutdown
|
|
|
|
this.onServerExit();
|
|
|
|
// Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
2023-04-09 20:38:32 +02:00
|
|
|
index f332af9c9e16c3851c5a14dad9ad182dd731ed87..755c223ab2a046285eb9916b6195093714f4c5ba 100644
|
2022-08-21 04:57:17 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
2023-03-14 22:10:53 +01:00
|
|
|
@@ -18,6 +18,12 @@ public class Main {
|
2022-08-21 04:57:17 +02:00
|
|
|
public static boolean useJline = true;
|
|
|
|
public static boolean useConsole = true;
|
|
|
|
|
|
|
|
+ // Paper start - Hijack log manager to ensure logging on shutdown
|
|
|
|
+ static {
|
|
|
|
+ System.setProperty("java.util.logging.manager", "io.papermc.paper.log.CustomLogManager");
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
public static void main(String[] args) {
|
|
|
|
// Paper start
|
|
|
|
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
|