rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vongosl...@apache.org
Subject [rocketmq] branch develop updated: [ISSUE #512]Bugfix for option -p can not print config items when using admin tool (#514)
Date Fri, 02 Nov 2018 14:26:36 GMT
This is an automated email from the ASF dual-hosted git repository.

vongosling pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 37223ca  [ISSUE #512]Bugfix for option -p can not print config items when using admin
tool (#514)
37223ca is described below

commit 37223cac73e828b4847bc86397abe03fb9ed7e8c
Author: ymwneu <ymwneu@126.com>
AuthorDate: Fri Nov 2 22:26:29 2018 +0800

    [ISSUE #512]Bugfix for option -p can not print config items when using admin tool (#514)
---
 .../main/java/org/apache/rocketmq/common/constant/LoggerName.java    | 1 +
 distribution/conf/logback_namesrv.xml                                | 5 +++++
 .../src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java    | 5 +++--
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/src/main/java/org/apache/rocketmq/common/constant/LoggerName.java b/common/src/main/java/org/apache/rocketmq/common/constant/LoggerName.java
index 12070dd..fe0ae9f 100644
--- a/common/src/main/java/org/apache/rocketmq/common/constant/LoggerName.java
+++ b/common/src/main/java/org/apache/rocketmq/common/constant/LoggerName.java
@@ -19,6 +19,7 @@ package org.apache.rocketmq.common.constant;
 public class LoggerName {
     public static final String FILTERSRV_LOGGER_NAME = "RocketmqFiltersrv";
     public static final String NAMESRV_LOGGER_NAME = "RocketmqNamesrv";
+    public static final String NAMESRV_CONSOLE_NAME = "RocketmqNamesrvConsole";
     public static final String BROKER_LOGGER_NAME = "RocketmqBroker";
     public static final String BROKER_CONSOLE_NAME = "RocketmqConsole";
     public static final String CLIENT_LOGGER_NAME = "RocketmqClient";
diff --git a/distribution/conf/logback_namesrv.xml b/distribution/conf/logback_namesrv.xml
index 5328894..36eda68 100644
--- a/distribution/conf/logback_namesrv.xml
+++ b/distribution/conf/logback_namesrv.xml
@@ -82,6 +82,11 @@
         <appender-ref ref="RocketmqNamesrvAppender"/>
     </logger>
 
+    <logger name="RocketmqNamesrvConsole" additivity="false">
+        <level value="INFO"/>
+        <appender-ref ref="STDOUT"/>
+    </logger>
+
     <root>
         <level value="INFO"/>
         <appender-ref ref="DefaultAppender"/>
diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java
index 24e7c26..9b49567 100644
--- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java
+++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java
@@ -99,8 +99,9 @@ public class NamesrvStartup {
         }
 
         if (commandLine.hasOption('p')) {
-            MixAll.printObjectProperties(null, namesrvConfig);
-            MixAll.printObjectProperties(null, nettyServerConfig);
+            InternalLogger console = InternalLoggerFactory.getLogger(LoggerName.NAMESRV_CONSOLE_NAME);
+            MixAll.printObjectProperties(console, namesrvConfig);
+            MixAll.printObjectProperties(console, nettyServerConfig);
             System.exit(0);
         }
 


Mime
View raw message