mirror of https://github.com/apache/lucene.git
SOLR-4868: fix inability to set root logger in Log4JWatcher
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1487294 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ee096e5cf8
commit
a79ffdfeee
|
@ -204,6 +204,9 @@ Bug Fixes
|
||||||
* SOLR-4734: Leader election fails with an NPE if there is no UpdateLog.
|
* SOLR-4734: Leader election fails with an NPE if there is no UpdateLog.
|
||||||
(Mark Miller, Alexander Eibner)
|
(Mark Miller, Alexander Eibner)
|
||||||
|
|
||||||
|
* SOLR-4868: Setting the log level for the log4j root category results in
|
||||||
|
adding a new category, the empty string. (Shawn Heisey)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -66,10 +66,12 @@ public class Log4jWatcher extends LogWatcher<LoggingEvent> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLogLevel(String category, String level) {
|
public void setLogLevel(String category, String level) {
|
||||||
|
org.apache.log4j.Logger log;
|
||||||
if(LoggerInfo.ROOT_NAME.equals(category)) {
|
if(LoggerInfo.ROOT_NAME.equals(category)) {
|
||||||
category = "";
|
log = org.apache.log4j.LogManager.getRootLogger();
|
||||||
|
} else {
|
||||||
|
log = org.apache.log4j.Logger.getLogger(category);
|
||||||
}
|
}
|
||||||
org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(category);
|
|
||||||
if(level==null||"unset".equals(level)||"null".equals(level)) {
|
if(level==null||"unset".equals(level)||"null".equals(level)) {
|
||||||
log.setLevel(null);
|
log.setLevel(null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue