PaperMC/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch

45 lines
1.8 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Thu, 12 Aug 2021 04:46:41 -0700
Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
diff --git a/build.gradle.kts b/build.gradle.kts
2024-12-04 04:04:41 +01:00
index 72a48e3971d63e0cb9aec1bfa21dd291a530a73d..ea6865398308111dd36a81401b53c9db8a8fc74a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
2024-12-04 04:04:41 +01:00
@@ -48,6 +48,7 @@ dependencies {
2022-06-07 23:45:11 +02:00
implementation("commons-lang:commons-lang:2.6")
2024-12-03 18:27:11 +01:00
runtimeOnly("org.xerial:sqlite-jdbc:3.47.0.0")
2024-10-22 19:28:57 +02:00
runtimeOnly("com.mysql:mysql-connector-j:9.1.0")
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
2024-04-23 21:23:27 +02:00
index ab1caec640128aa90f246e4bbecf5ca275e7982e..18e961a37b2830da6e5dab7aa35116b2f5215898 100644
--- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml
@@ -29,15 +29,18 @@
</Policies>
<DefaultRolloverStrategy max="1000"/>
</RollingRandomAccessFile>
+ <Async name="Async">
+ <AppenderRef ref="File"/>
+ <AppenderRef ref="TerminalConsole" level="info"/>
+ <AppenderRef ref="ServerGuiConsole" level="info"/>
+ </Async>
</Appenders>
<Loggers>
<Root level="info">
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
</filters>
- <AppenderRef ref="File"/>
- <AppenderRef ref="TerminalConsole" level="info"/>
- <AppenderRef ref="ServerGuiConsole" level="info"/>
+ <AppenderRef ref="Async"/>
</Root>
</Loggers>
</Configuration>