diff options
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/DedicatedServer.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java index 03585b7a..1b116878 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -46,18 +46,19 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer threadcommandreader.setDaemon(true); threadcommandreader.start(); - // CraftBukkit start - TODO: See if this needs fixing - final org.apache.logging.log4j.core.Logger realLogger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger()); - for (org.apache.logging.log4j.core.Appender appender : realLogger.getAppenders().values()) { - if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) { - realLogger.removeAppender(appender); - } + // CraftBukkit start - TODO: handle command-line logging arguments + java.util.logging.Logger global = java.util.logging.Logger.getLogger(""); + global.setUseParentHandlers(false); + for (java.util.logging.Handler handler : global.getHandlers()) { + global.removeHandler(handler); } + global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler()); + final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger()); new Thread(new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader)).start(); - System.setOut(new PrintStream(new LoggerOutputStream(realLogger, Level.INFO), true)); - System.setErr(new PrintStream(new LoggerOutputStream(realLogger, Level.WARN), true)); + System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); + System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); // CraftBukkit end h.info("Starting minecraft server version 1.7.2"); |