mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 03:53:00 +08:00
Clean up the server's logger.
This commit is contained in:
parent
f86b4bec11
commit
f5bc750150
@ -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} <%highlight(%level):%gray(%class{0})> %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'} <%level:%class> %m%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="SERVEREVENT" class="emu.grasscutter.utils.ServerLogEventAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss} <%highlight(%level):%gray(%class{0})> %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">
|
||||
|
Loading…
Reference in New Issue
Block a user