Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
f5bc7501
Commit
f5bc7501
authored
Jun 26, 2022
by
KingRainbow44
Browse files
Clean up the server's logger.
parent
f86b4bec
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/Grasscutter.java
View file @
f5bc7501
...
...
@@ -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."
);
}
...
...
src/main/resources/logback.xml
View file @
f5bc7501
...
...
@@ -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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment