From f6e41c856c7fbef5050394792d92a96a593d4813 Mon Sep 17 00:00:00 2001 From: Gabscap Date: Fri, 20 Jun 2014 03:51:57 +0200 Subject: [PATCH] Closing all handlers on stop() --- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index ab75b390..4459d0f5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -41,6 +41,7 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import jline.UnsupportedTerminal; @@ -360,6 +361,11 @@ public class BungeeCord extends ProxyServer scheduler.shutdown(); getLogger().info( "Thank you and goodbye" ); + // Need to close loggers after last message! + for ( Handler handler : getLogger().getHandlers() ) + { + handler.close(); + } System.exit( 0 ); } }.start();