Skip to content

Commit c019e30

Browse files
authored
fix: performance issues due to missing mc packet logging filter (#1860)
### Motivation Our logback instance replaces log4j implementations and thus also filters that might be defined in log4j configs. ### Modification Copied the mc packet filter to our logback config to ensure proper filtering of network packets. ### Result Performance issues due to massive logging resolved
1 parent 67b9e0a commit c019e30

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

wrapper-jvm/impl/src/main/resources/logback.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<configuration>
1818
<import class="ch.qos.logback.core.ConsoleAppender"/>
19+
<import class="ch.qos.logback.classic.turbo.MarkerFilter"/>
1920
<import class="ch.qos.logback.classic.filter.LevelFilter"/>
2021
<import class="ch.qos.logback.classic.filter.ThresholdFilter"/>
2122
<import class="ch.qos.logback.core.rolling.RollingFileAppender"/>
@@ -33,6 +34,13 @@
3334
<!-- allow configuring log levels using properties file -->
3435
<propertiesConfigurator optional="true" file="${cloudnet.log.properties.file}"/>
3536

37+
<!-- discards mc related packets with NETWORK_PACKETS marker -->
38+
<turboFilter class="MarkerFilter">
39+
<Marker>${cloudnet.wrapper.log.packet-filter.marker:-NETWORK_PACKETS}</Marker>
40+
<OnMatch>${cloudnet.wrapper.log.packet-filter.on-match:-DENY}</OnMatch>
41+
<OnMismatch>NEUTRAL</OnMismatch>
42+
</turboFilter>
43+
3644
<property name="LOG_PATTERN" value="[%d{dd.MM HH:mm:ss.SSS}] %-5level: %msg%n"/>
3745
<appender name="Rolling" class="RollingFileAppender">
3846
<file>${cloudnet.log.path}/latest.log</file>

0 commit comments

Comments
 (0)