mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
fix logger command do not work with Log4j2. ##1394 #1395
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user