mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 08:42:53 +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.
|
// 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 {
|
|||||||
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 @@
|
|||||||
<pattern>%d{HH:mm:ss} <%highlight(%level):%gray(%class{0})> %msg%n</pattern>
|
<pattern>%d{HH:mm:ss} <%highlight(%level):%gray(%class{0})> %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 @@
|
|||||||
<pattern>%d{yyyy-MM-dd'T'HH:mm:ss'Z'} <%level:%class> %m%n</pattern>
|
<pattern>%d{yyyy-MM-dd'T'HH:mm:ss'Z'} <%level:%class> %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} <%highlight(%level):%gray(%class{0})> %msg%n</pattern>
|
<pattern>%d{HH:mm:ss} <%highlight(%level):%gray(%class{0})> %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">
|
||||||
|
Loading…
Reference in New Issue
Block a user