From f5bc750150cf5b5b400066b2a60812961eb95329 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Sun, 26 Jun 2022 13:03:10 -0400 Subject: [PATCH] Clean up the server's logger. --- src/main/java/emu/grasscutter/Grasscutter.java | 5 +++++ src/main/resources/logback.xml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/main/java/emu/grasscutter/Grasscutter.java b/src/main/java/emu/grasscutter/Grasscutter.java index d27e597b2..24b6caf8a 100644 --- a/src/main/java/emu/grasscutter/Grasscutter.java +++ b/src/main/java/emu/grasscutter/Grasscutter.java @@ -69,6 +69,10 @@ public final class Grasscutter { // Declare logback configuration. System.setProperty("logback.configurationFile", "src/main/resources/logback.xml"); + // Disable the MongoDB logger. + var mongoLogger = (Logger) LoggerFactory.getLogger("org.mongodb.driver"); + mongoLogger.setLevel(Level.OFF); + // Load server configuration. Grasscutter.loadConfig(); // Attempt to update configuration. @@ -101,6 +105,7 @@ public final class Grasscutter { exitEarly = true; } case "-debug" -> { + // Set the logger to debug. log.setLevel(Level.DEBUG); log.debug("The logger is now running in debug mode."); } diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index e3fa8a9dd..81b141f26 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -6,6 +6,7 @@ %d{HH:mm:ss} <%highlight(%level):%gray(%class{0})> %msg%n + logs/latest.log @@ -16,13 +17,18 @@ %d{yyyy-MM-dd'T'HH:mm:ss'Z'} <%level:%class> %m%n + %d{HH:mm:ss} <%highlight(%level):%gray(%class{0})> %msg%n + + + +