Disable Log4J's built-in shutdown hook, because it broke logging in the shutdown sequence when exiting by interrupting the process. This was caused by the Log4J's hook running before ours. (#637)

This commit is contained in:
kyngs
2022-03-14 04:59:50 +01:00
committed by GitHub
parent 94e8b0df43
commit f0ea638fa1
2 changed files with 5 additions and 1 deletions

View File

@@ -502,6 +502,9 @@ public class VelocityServer implements ProxyServer, ForwardingAudience {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
// Since we manually removed the shutdown hook, we need to handle the shutdown ourselves.
LogManager.shutdown();
shutdown = true; shutdown = true;
if (explicitExit) { if (explicitExit) {

View File

@@ -16,7 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
--> -->
<Configuration status="warn"> <!-- Disable shutdown hook, because we have our own -->
<Configuration status="warn" shutdownHook="disable">
<Appenders> <Appenders>
<TerminalConsole name="TerminalConsole"> <TerminalConsole name="TerminalConsole">
<PatternLayout> <PatternLayout>