From 0fc15b8105e2fdeca31718d2eb61cac14b2db0eb Mon Sep 17 00:00:00 2001 From: DNx5 Date: Thu, 31 Mar 2016 19:16:05 +0700 Subject: [PATCH] Fix removePassword option not working on KCauldron. --- src/main/java/fr/xephi/authme/AuthMe.java | 8 +++++--- src/main/java/fr/xephi/authme/output/Log4JFilter.java | 6 ------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index b9195af0b..b8d9bf266 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -624,11 +624,13 @@ public class AuthMe extends JavaPlugin { // Set the console filter to remove the passwords private void setLog4JFilter() { Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { - @Override public void run() { - org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger(); - coreLogger.addFilter(new Log4JFilter()); + org.apache.logging.log4j.core.Logger logger; + logger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger(); + logger.addFilter(new Log4JFilter()); + logger = (org.apache.logging.log4j.core.Logger) LogManager.getLogger("net.minecraft"); + logger.addFilter(new Log4JFilter()); } }); } diff --git a/src/main/java/fr/xephi/authme/output/Log4JFilter.java b/src/main/java/fr/xephi/authme/output/Log4JFilter.java index 9b2bea4c3..d72d3014c 100644 --- a/src/main/java/fr/xephi/authme/output/Log4JFilter.java +++ b/src/main/java/fr/xephi/authme/output/Log4JFilter.java @@ -51,9 +51,6 @@ public class Log4JFilter implements Filter { @Override public Result filter(LogEvent record) { - if (record == null) { - return Result.NEUTRAL; - } return validateMessage(record.getMessage()); } @@ -64,9 +61,6 @@ public class Log4JFilter implements Filter { @Override public Result filter(Logger arg0, Level arg1, Marker arg2, Object message, Throwable arg4) { - if (message == null) { - return Result.NEUTRAL; - } return validateMessage(message.toString()); }