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 {
// 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.");
}
......
......@@ -6,6 +6,7 @@
<pattern>%d{HH:mm:ss} &lt;%highlight(%level):%gray(%class{0})&gt; %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/latest.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
......@@ -16,13 +17,18 @@
<pattern>%d{yyyy-MM-dd'T'HH:mm:ss'Z'} &lt;%level:%class&gt; %m%n</pattern>
</encoder>
</appender>
<appender name="SERVEREVENT" class="emu.grasscutter.utils.ServerLogEventAppender">
<encoder>
<pattern>%d{HH:mm:ss} &lt;%highlight(%level):%gray(%class{0})&gt; %msg%n</pattern>
</encoder>
</appender>
<logger name="express" level="OFF" />
<logger name="org.quartz" level="OFF" />
<logger name="org.reflections" level="OFF" />
<logger name="org.eclipse.jetty" level="OFF" />
<logger name="emu.grasscutter" level="${LOG_LEVEL}" />
<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