aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2019-06-29 21:00:16 -0700
committerSpottedleaf <[email protected]>2019-06-29 21:00:16 -0700
commit0626875a59227680a0a7036c7a1bb8fb0f4f21ff (patch)
treee2195b8681a3430438d7b75073a3e155996a6f3f
parentf9494493380622dc227b3991802793fcc184dca1 (diff)
downloadPaper-0626875a59227680a0a7036c7a1bb8fb0f4f21ff.tar.gz
Paper-0626875a59227680a0a7036c7a1bb8fb0f4f21ff.zip
Queue log events when log buffer is full
This should resolve out of order logs when the buffer is full
-rw-r--r--Spigot-Server-Patches/0334-Use-asynchronous-Log4j-2-loggers.patch31
1 files changed, 26 insertions, 5 deletions
diff --git a/Spigot-Server-Patches/0334-Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/0334-Use-asynchronous-Log4j-2-loggers.patch
index fe727e67ca..eb32ec60f8 100644
--- a/Spigot-Server-Patches/0334-Use-asynchronous-Log4j-2-loggers.patch
+++ b/Spigot-Server-Patches/0334-Use-asynchronous-Log4j-2-loggers.patch
@@ -1,11 +1,11 @@
-From 03f5b3714e9388890e9261da44070032119ae5ad Mon Sep 17 00:00:00 2001
+From 278d18093d088586a50ef35a69393e8266091de9 Mon Sep 17 00:00:00 2001
From: Minecrell <[email protected]>
Date: Tue, 17 Jul 2018 16:42:17 +0200
Subject: [PATCH] Use asynchronous Log4j 2 loggers
diff --git a/pom.xml b/pom.xml
-index 7fa70efe8..132843880 100644
+index 7fa70efe80..132843880a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,6 +110,14 @@
@@ -23,13 +23,34 @@ index 7fa70efe8..132843880 100644
<!-- testing -->
<dependency>
<groupId>junit</groupId>
+diff --git a/src/main/java/com/destroystokyo/paper/log/LogFullPolicy.java b/src/main/java/com/destroystokyo/paper/log/LogFullPolicy.java
+new file mode 100644
+index 0000000000..dceb121bcc
+--- /dev/null
++++ b/src/main/java/com/destroystokyo/paper/log/LogFullPolicy.java
+@@ -0,0 +1,13 @@
++package com.destroystokyo.paper.log;
++
++import org.apache.logging.log4j.Level;
++import org.apache.logging.log4j.core.async.AsyncQueueFullPolicy;
++import org.apache.logging.log4j.core.async.EventRoute;
++
++public final class LogFullPolicy implements AsyncQueueFullPolicy {
++
++ @Override
++ public EventRoute getRoute(final long backgroundThreadId, final Level level) {
++ return EventRoute.ENQUEUE;
++ }
++}
diff --git a/src/main/resources/log4j2.component.properties b/src/main/resources/log4j2.component.properties
new file mode 100644
-index 000000000..ee7c90784
+index 0000000000..ee683079c1
--- /dev/null
+++ b/src/main/resources/log4j2.component.properties
-@@ -0,0 +1 @@
+@@ -0,0 +1,2 @@
+Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
++log4j2.AsyncQueueFullPolicy=com.destroystokyo.paper.log.LogFullPolicy
+\ No newline at end of file
--
-2.18.0
+2.22.0