fix logger command do not work with Log4j2. ##1394 #1395

pull/1401/head
394049428@qq.com 5 years ago committed by hengyunabc
parent 54d672ff97
commit 8dfe26625b

@ -19,8 +19,6 @@ import org.apache.logging.log4j.core.appender.FileAppender;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import com.taobao.arthas.core.util.StringUtils;
/**
*
* @author hengyunabc 2019-09-20
@ -96,7 +94,7 @@ public class Log4j2Helper {
return loggerInfoMap;
}
// 排掉非root时获取到root的logger config
if (!name.equalsIgnoreCase(LoggerConfig.ROOT) && StringUtils.isEmpty(loggerConfig.getName())) {
if (!name.equalsIgnoreCase(LoggerConfig.ROOT) && isEmpty(loggerConfig.getName())) {
return loggerInfoMap;
}
loggerInfoMap.put(name, doGetLoggerInfo(loggerConfig));
@ -190,4 +188,7 @@ public class Log4j2Helper {
return result;
}
private static boolean isEmpty(Object str) {
return str == null || "".equals(str);
}
}

Loading…
Cancel
Save