You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/03/02 07:09:41 UTC

[pulsar] branch master updated: [logging] make root log level configurable (#3661)

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 5fd5730  [logging] make root log level configurable (#3661)
5fd5730 is described below

commit 5fd5730f8da7dff3b094c0943fc959ca1d6aea85
Author: Sijie Guo <gu...@gmail.com>
AuthorDate: Sat Mar 2 15:09:36 2019 +0800

    [logging] make root log level configurable (#3661)
    
    *Motivation*
    
    Currently there is no way to configurable pulsar broker logging to debug level,
    unless modify log4j2.yaml directly
    
    *Modifications*
    
    Introduce `pulsar.log.root.level` for configuring root log level.
    Make it configurable by `PULSAR_LOG_ROOT_LEVEL`
---
 bin/pulsar       | 1 +
 conf/log4j2.yaml | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/pulsar b/bin/pulsar
index 50b27d6..2ef9a07 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -267,6 +267,7 @@ OPTS="$OPTS $PULSAR_EXTRA_OPTS"
 # log directory & file
 PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"}
 PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"RoutingAppender"}
+PULSAR_LOG_ROOT_LEVEL=${PULSAR_LOG_ROOT_LEVEL:-"debug"}
 PULSAR_LOG_LEVEL=${PULSAR_LOG_LEVEL:-"info"}
 PULSAR_ROUTING_APPENDER_DEFAULT=${PULSAR_ROUTING_APPENDER_DEFAULT:-"Console"}
 
diff --git a/conf/log4j2.yaml b/conf/log4j2.yaml
index 143b4f8..8ab65af 100644
--- a/conf/log4j2.yaml
+++ b/conf/log4j2.yaml
@@ -32,6 +32,8 @@ Configuration:
         value: "pulsar.log"
       - name: "pulsar.log.appender"
         value: "RoutingAppender"
+      - name: "pulsar.log.root.level"
+        value: "debug"
       - name: "pulsar.log.level"
         value: "info"
       - name: "pulsar.routing.appender.default"
@@ -128,7 +130,7 @@ Configuration:
 
     # Default root logger configuration
     Root:
-      level: info
+      level: "${sys:pulsar.log.root.level}"
       additivity: true
       AppenderRef:
         - ref: "${sys:pulsar.log.appender}"