Deregister logger handlers as last thing
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Jul 2015 10:54:23 +0000 (12:54 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Jul 2015 10:54:42 +0000 (12:54 +0200)
src/main/java/net/pterodactylus/sone/main/SonePlugin.java

index 1df4a33..ffaad9f 100644 (file)
@@ -295,7 +295,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
         */
        @Override
        public void terminate() {
-               deregisterLoggerHandlers();
                try {
                        /* stop the web interface. */
                        webInterface.stop();
@@ -307,6 +306,8 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                        webOfTrustConnector.stop();
                } catch (Throwable t1) {
                        logger.log(Level.SEVERE, "Error while shutting down!", t1);
+               } finally {
+                       deregisterLoggerHandlers();
                }
        }