Github user Jaskey commented on a diff in the pull request:
https://github.com/apache/incubator-rocketmq/pull/85#discussion_r108666872
--- Diff:
tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java ---
@@ -196,22 +196,11 @@ private static void initLog() {
ILoggerFactory iLoggerFactory =
LoggerFactory.getILoggerFactory();
Class classType = iLoggerFactory.getClass();
if
(classType.getName().equals("org.slf4j.impl.Log4jLoggerFactory")) {
- Class<?> domconfigurator;
- Object domconfiguratorobj;
- domconfigurator =
Class.forName("org.apache.log4j.xml.DOMConfigurator");
- domconfiguratorobj = domconfigurator.newInstance();
- Method configure =
domconfiguratorobj.getClass().getMethod("configure", String.class);
- configure.invoke(domconfiguratorobj, rocketmqHome +
"/conf/log4j_tools.xml");
+ final String logfjConfigPath = rocketmqHome +
"/conf/log4j_tools.xml";
+ LogUtils.configLog4j(logfjConfigPath,null);
} else if
(classType.getName().equals("ch.qos.logback.classic.LoggerContext")) {
- Class<?> joranConfigurator;
--- End diff --
@vongosling the updated pr has been extract two logger config into util
function. Do you mean the if else code snippet is need to wrap too?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---