diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java
index 98ff136574b6ad2aa5be513ded9f3add08ecb59c..85d2e3af514ba1c1a106882042bff7c408c018f1 100644
--- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java
+++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java
@@ -103,20 +103,6 @@ public class BrokerStartup {
messageStoreConfig.setAccessMessageInMemoryMaxRatio(ratio);
}
- if (commandLine.hasOption('p')) {
- MixAll.printObjectProperties(null, brokerConfig);
- MixAll.printObjectProperties(null, nettyServerConfig);
- MixAll.printObjectProperties(null, nettyClientConfig);
- MixAll.printObjectProperties(null, messageStoreConfig);
- System.exit(0);
- } else if (commandLine.hasOption('m')) {
- MixAll.printObjectProperties(null, brokerConfig, true);
- MixAll.printObjectProperties(null, nettyServerConfig, true);
- MixAll.printObjectProperties(null, nettyClientConfig, true);
- MixAll.printObjectProperties(null, messageStoreConfig, true);
- System.exit(0);
- }
-
if (commandLine.hasOption('c')) {
String file = commandLine.getOptionValue('c');
if (file != null) {
@@ -181,8 +167,24 @@ public class BrokerStartup {
configurator.setContext(lc);
lc.reset();
configurator.doConfigure(brokerConfig.getRocketmqHome() + "/conf/logback_broker.xml");
- log = LoggerFactory.getLogger(LoggerName.BROKER_LOGGER_NAME);
+ if (commandLine.hasOption('p')) {
+ Logger console = LoggerFactory.getLogger(LoggerName.BROKER_CONSOLE_NAME);
+ MixAll.printObjectProperties(console, brokerConfig);
+ MixAll.printObjectProperties(console, nettyServerConfig);
+ MixAll.printObjectProperties(console, nettyClientConfig);
+ MixAll.printObjectProperties(console, messageStoreConfig);
+ System.exit(0);
+ } else if (commandLine.hasOption('m')) {
+ Logger console = LoggerFactory.getLogger(LoggerName.BROKER_CONSOLE_NAME);
+ MixAll.printObjectProperties(console, brokerConfig, true);
+ MixAll.printObjectProperties(console, nettyServerConfig, true);
+ MixAll.printObjectProperties(console, nettyClientConfig, true);
+ MixAll.printObjectProperties(console, messageStoreConfig, true);
+ System.exit(0);
+ }
+
+ log = LoggerFactory.getLogger(LoggerName.BROKER_LOGGER_NAME);
MixAll.printObjectProperties(log, brokerConfig);
MixAll.printObjectProperties(log, nettyServerConfig);
MixAll.printObjectProperties(log, nettyClientConfig);
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 385c1214340e389ca2478fb990f04edec6a36ac3..12070ddc34ee8076cc22c3e92afa65641833441e 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
@@ -20,6 +20,7 @@ public class LoggerName {
public static final String FILTERSRV_LOGGER_NAME = "RocketmqFiltersrv";
public static final String NAMESRV_LOGGER_NAME = "RocketmqNamesrv";
public static final String BROKER_LOGGER_NAME = "RocketmqBroker";
+ public static final String BROKER_CONSOLE_NAME = "RocketmqConsole";
public static final String CLIENT_LOGGER_NAME = "RocketmqClient";
public static final String TOOLS_LOGGER_NAME = "RocketmqTools";
public static final String COMMON_LOGGER_NAME = "RocketmqCommon";
diff --git a/distribution/conf/logback_broker.xml b/distribution/conf/logback_broker.xml
index dd5c63f5de0378d04464e1a2c977599ea8e46176..3945fac388ecf0937dd2b401fc24b31b7a363357 100644
--- a/distribution/conf/logback_broker.xml
+++ b/distribution/conf/logback_broker.xml
@@ -349,6 +349,11 @@
+
+
+
+
+