diff --git a/src/main/java/com/sk89q/worldguard/util/logging/RecordMessagePrefixer.java b/src/main/java/com/sk89q/worldguard/util/logging/RecordMessagePrefixer.java index 86278aac..f18cbde8 100644 --- a/src/main/java/com/sk89q/worldguard/util/logging/RecordMessagePrefixer.java +++ b/src/main/java/com/sk89q/worldguard/util/logging/RecordMessagePrefixer.java @@ -62,9 +62,12 @@ public void close() throws SecurityException { public static void register(Logger logger, String prefix) { checkNotNull(logger); + // Fix issues with multiple classloaders loading the same class + String className = RecordMessagePrefixer.class.getCanonicalName(); + logger.setUseParentHandlers(false); for (Handler handler : logger.getHandlers()) { - if (handler instanceof RecordMessagePrefixer) { + if (handler.getClass().getCanonicalName().equals(className)) { logger.removeHandler(handler); } }