diff options
-rw-r--r-- | src/main/java/net/minecraft/server/DedicatedServer.java | 6 | ||||
-rw-r--r-- | src/main/resources/log4j2.xml | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java index 1b116878..30ce5f48 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -55,6 +55,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler()); final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger()); + for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) { + if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) { + logger.removeAppender(appender); + } + } + new Thread(new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader)).start(); System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index c868e8c5..36eff853 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN" packages="net.minecraft,com.mojang"> <Appenders> + <Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console> <Queue name="TerminalConsole"> <PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" /> </Queue> @@ -17,6 +18,7 @@ <filters> <MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" /> </filters> + <AppenderRef ref="WINDOWS_COMPAT"/> <AppenderRef ref="File"/> <AppenderRef ref="TerminalConsole"/> </Root> |