Skip to content

Commit 8a7acd0

Browse files
committed
Fix log level config for pulsar-admin, pulsar-client and pulsar-perf (#12915)
- Logger.isDebugEnabled will evaluate to true in the default configuration due to #7789 change (cherry picked from commit 6200ef1)
1 parent 2d09237 commit 8a7acd0

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

bin/pulsar-admin-common.sh

+2
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,13 @@ OPTS="$OPTS $PULSAR_EXTRA_OPTS"
9898
# log directory & file
9999
PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"}
100100
PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"RoutingAppender"}
101+
PULSAR_LOG_ROOT_LEVEL=${PULSAR_LOG_ROOT_LEVEL:-"info"}
101102
PULSAR_LOG_LEVEL=${PULSAR_LOG_LEVEL:-"info"}
102103
PULSAR_ROUTING_APPENDER_DEFAULT=${PULSAR_ROUTING_APPENDER_DEFAULT:-"Console"}
103104

104105
#Configure log configuration system properties
105106
OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER"
106107
OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR"
107108
OPTS="$OPTS -Dpulsar.log.level=$PULSAR_LOG_LEVEL"
109+
OPTS="$OPTS -Dpulsar.log.root.level=$PULSAR_LOG_ROOT_LEVEL"
108110
OPTS="$OPTS -Dpulsar.routing.appender.default=$PULSAR_ROUTING_APPENDER_DEFAULT"

bin/pulsar-client

+2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ OPTS="$OPTS $PULSAR_EXTRA_OPTS"
101101
# log directory & file
102102
PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"}
103103
PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"}
104+
PULSAR_LOG_ROOT_LEVEL=${PULSAR_LOG_ROOT_LEVEL:-"info"}
104105
PULSAR_LOG_LEVEL=${PULSAR_LOG_LEVEL:-"info"}
105106

106107
#Configure log configuration system properties
107108
OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR"
108109
OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER"
109110
OPTS="$OPTS -Dpulsar.log.level=$PULSAR_LOG_LEVEL"
111+
OPTS="$OPTS -Dpulsar.log.root.level=$PULSAR_LOG_ROOT_LEVEL"
110112

111113
#Change to PULSAR_HOME to support relative paths
112114
cd "$PULSAR_HOME"

bin/pulsar-perf

+4
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,13 @@ OPTS="$OPTS $PULSAR_EXTRA_OPTS"
137137
PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"}
138138
PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"}
139139
PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"pulsar-perftest.log"}
140+
PULSAR_LOG_ROOT_LEVEL=${PULSAR_LOG_ROOT_LEVEL:-"info"}
141+
PULSAR_LOG_LEVEL=${PULSAR_LOG_LEVEL:-"info"}
140142

141143
#Configure log configuration system properties
142144
OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER"
145+
OPTS="$OPTS -Dpulsar.log.level=$PULSAR_LOG_LEVEL"
146+
OPTS="$OPTS -Dpulsar.log.root.level=$PULSAR_LOG_ROOT_LEVEL"
143147
OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR"
144148
OPTS="$OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE"
145149

0 commit comments

Comments
 (0)