Commit f5bc7501 authored by KingRainbow44's avatar KingRainbow44
Browse files

Clean up the server's logger.

parent f86b4bec
...@@ -69,6 +69,10 @@ public final class Grasscutter { ...@@ -69,6 +69,10 @@ public final class Grasscutter {
// Declare logback configuration. // Declare logback configuration.
System.setProperty("logback.configurationFile", "src/main/resources/logback.xml"); 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. // Load server configuration.
Grasscutter.loadConfig(); Grasscutter.loadConfig();
// Attempt to update configuration. // Attempt to update configuration.
...@@ -101,6 +105,7 @@ public final class Grasscutter { ...@@ -101,6 +105,7 @@ public final class Grasscutter {
exitEarly = true; exitEarly = true;
} }
case "-debug" -> { case "-debug" -> {
// Set the logger to debug.
log.setLevel(Level.DEBUG); log.setLevel(Level.DEBUG);
log.debug("The logger is now running in debug mode."); log.debug("The logger is now running in debug mode.");
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<pattern>%d{HH:mm:ss} &lt;%highlight(%level):%gray(%class{0})&gt; %msg%n</pattern> <pattern>%d{HH:mm:ss} &lt;%highlight(%level):%gray(%class{0})&gt; %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/latest.log</file> <file>logs/latest.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
...@@ -16,13 +17,18 @@ ...@@ -16,13 +17,18 @@
<pattern>%d{yyyy-MM-dd'T'HH:mm:ss'Z'} &lt;%level:%class&gt; %m%n</pattern> <pattern>%d{yyyy-MM-dd'T'HH:mm:ss'Z'} &lt;%level:%class&gt; %m%n</pattern>
</encoder> </encoder>
</appender> </appender>
<appender name="SERVEREVENT" class="emu.grasscutter.utils.ServerLogEventAppender"> <appender name="SERVEREVENT" class="emu.grasscutter.utils.ServerLogEventAppender">
<encoder> <encoder>
<pattern>%d{HH:mm:ss} &lt;%highlight(%level):%gray(%class{0})&gt; %msg%n</pattern> <pattern>%d{HH:mm:ss} &lt;%highlight(%level):%gray(%class{0})&gt; %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<logger name="express" level="OFF" />
<logger name="org.quartz" level="OFF" />
<logger name="org.reflections" level="OFF" /> <logger name="org.reflections" level="OFF" />
<logger name="org.eclipse.jetty" level="OFF" />
<logger name="emu.grasscutter" level="${LOG_LEVEL}" /> <logger name="emu.grasscutter" level="${LOG_LEVEL}" />
<root level="INFO"> <root level="INFO">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment