From c6550e46d4fb0c4e25f77f7e3ecc17612c17bbf6 Mon Sep 17 00:00:00 2001 From: Bruno Bonnin Date: Mon, 12 Oct 2020 02:26:50 +0200 Subject: [PATCH] Add log level config in pulsar-client (#8195) ### 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). --- bin/pulsar-client | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/pulsar-client b/bin/pulsar-client index f0e2213484853..122230a84db61 100755 --- a/bin/pulsar-client +++ b/bin/pulsar-client @@ -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"