Skip to content

Commit

Permalink
Add log level config in pulsar-client (apache#8195)
Browse files Browse the repository at this point in the history
### Motivation
When using pulsar-client CLI, we have a lot of log4j logs useless for just sending/receiving messages.
It could great to not display these logs with just a env variable (like in pulsar-admin).

### Modifications
The log level can be configured with the system property `pulsar.log.level` for the Java application.
The modification is the ability to set this level using a env variable PULSAR_LOG_LEVEL (default: info).
  • Loading branch information
bbonnin authored Oct 12, 2020
1 parent a6908b8 commit c6550e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/pulsar-client
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ OPTS="$OPTS $PULSAR_EXTRA_OPTS"
# log directory & file
PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"}
PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"}
PULSAR_LOG_LEVEL=${PULSAR_LOG_LEVEL:-"info"}

#Configure log configuration system properties
OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR"
OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER"
OPTS="$OPTS -Dpulsar.log.level=$PULSAR_LOG_LEVEL"

#Change to PULSAR_HOME to support relative paths
cd "$PULSAR_HOME"
Expand Down

0 comments on commit c6550e4

Please sign in to comment.