diff options
Diffstat (limited to 'patches/server/0211-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch')
-rw-r--r-- | patches/server/0211-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/patches/server/0211-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/0211-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch new file mode 100644 index 0000000000..50b3a6608f --- /dev/null +++ b/patches/server/0211-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jason Penilla <[email protected]> +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 +index 38ded67b38bb5dc7c59eb610b81ac33d88d25dac..30edfbf16e7bed29b3261b51d9e4f3124beef026 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -36,6 +36,7 @@ dependencies { + implementation("commons-lang:commons-lang:2.6") + runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") + runtimeOnly("com.mysql:mysql-connector-j:8.2.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 +index 88957220d5574e5590e8a545605d76c0c7b0a10e..ea4e2161c0bd43884055cc6b8d70b2139f70e720 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> |