Skip to content

Commit

Permalink
Enable Log4j2 async loggers (apache#15188)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Apr 20, 2022
1 parent fd0532c commit 1e9a1f0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bin/pulsar
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions conf/log4j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 5 additions & 0 deletions distribution/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions distribution/server/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit 1e9a1f0

Please sign in to comment.