Closing all handlers on stop()

This commit is contained in:
Gabscap 2014-06-20 03:51:57 +02:00 committed by md_5
parent 151344aaff
commit f6e41c856c

View File

@ -41,6 +41,7 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Handler;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import jline.UnsupportedTerminal; import jline.UnsupportedTerminal;
@ -360,6 +361,11 @@ public class BungeeCord extends ProxyServer
scheduler.shutdown(); scheduler.shutdown();
getLogger().info( "Thank you and goodbye" ); getLogger().info( "Thank you and goodbye" );
// Need to close loggers after last message!
for ( Handler handler : getLogger().getHandlers() )
{
handler.close();
}
System.exit( 0 ); System.exit( 0 );
} }
}.start(); }.start();