This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 1e9a1f087e8 Enable Log4j2 async loggers (#15188)
1e9a1f087e8 is described below
commit 1e9a1f087e8c6fd9e78f6e3f0635113ba7927bbf
Author: Matteo Merli <[email protected]>
AuthorDate: Wed Apr 20 10:47:00 2022 +0200
Enable Log4j2 async loggers (#15188)
---
bin/pulsar | 5 ++++-
conf/log4j2.yaml | 1 +
distribution/server/pom.xml | 5 +++++
distribution/server/src/assemble/LICENSE.bin.txt | 2 ++
pom.xml | 2 +-
5 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/bin/pulsar b/bin/pulsar
index 3fa18483314..df8d8014412 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -309,8 +309,11 @@ OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR"
OPTS="$OPTS -Dpulsar.log.level=$PULSAR_LOG_LEVEL"
OPTS="$OPTS -Dpulsar.log.root.level=$PULSAR_LOG_ROOT_LEVEL"
OPTS="$OPTS -Dpulsar.routing.appender.default=$PULSAR_ROUTING_APPENDER_DEFAULT"
+
+
# Configure log4j2 to disable servlet webapp detection so that Garbage free
logging can be used
-OPTS="$OPTS -Dlog4j2.is.webapp=false"
+PULSAR_LOG4J_CONF=${PULSAR_LOG4J_CONF:-"-Dlog4j2.is.webapp=false
-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-Dlog4j2.enableThreadlocals=true -Dlog4j2.enableDirectEncoders=true"}
+OPTS="$OPTS $PULSAR_LOG4J_CONF"
# Functions related logging
OPTS="$OPTS -Dpulsar.functions.process.container.log.dir=$PULSAR_LOG_DIR"
diff --git a/conf/log4j2.yaml b/conf/log4j2.yaml
index 71698d72067..177c6adc44a 100644
--- a/conf/log4j2.yaml
+++ b/conf/log4j2.yaml
@@ -53,6 +53,7 @@ Configuration:
Console:
name: Console
target: SYSTEM_OUT
+ direct: true
PatternLayout:
Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t] %-5level %logger{36}
- %msg%n"
diff --git a/distribution/server/pom.xml b/distribution/server/pom.xml
index 8df81b6f75e..fd25bd8450b 100644
--- a/distribution/server/pom.xml
+++ b/distribution/server/pom.xml
@@ -64,6 +64,11 @@
<version>${jline.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.lmax</groupId>
+ <artifactId>disruptor</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper-prometheus-metrics</artifactId>
diff --git a/distribution/server/src/assemble/LICENSE.bin.txt
b/distribution/server/src/assemble/LICENSE.bin.txt
index 93b63433e7b..1553642f968 100644
--- a/distribution/server/src/assemble/LICENSE.bin.txt
+++ b/distribution/server/src/assemble/LICENSE.bin.txt
@@ -539,6 +539,8 @@ The Apache Software License, Version 2.0
- io.etcd-jetcd-core-0.5.11.jar
* IPAddress
- com.github.seancfoley-ipaddress-5.3.3.jar
+ * LMAX Disruptor
+ - com.lmax-disruptor-3.4.3.jar
BSD 3-clause "New" or "Revised" License
* Google auth library
diff --git a/pom.xml b/pom.xml
index 74e65701b78..91d1da47981 100644
--- a/pom.xml
+++ b/pom.xml
@@ -213,11 +213,11 @@ flexible messaging model and an intuitive client
API.</description>
<snakeyaml.version>1.30</snakeyaml.version>
<ant.version>1.10.12</ant.version>
<seancfoley.ipaddress.version>5.3.3</seancfoley.ipaddress.version>
+ <disruptor.version>3.4.3</disruptor.version>
<!-- test dependencies -->
<cassandra.version>3.6.0</cassandra.version>
- <disruptor.version>3.4.0</disruptor.version>
<testcontainers.version>1.15.3</testcontainers.version>
<hamcrest.version>2.2</hamcrest.version>