Methods Summary |
---|
public java.lang.String | getLoggerLevel(java.lang.String loggerName)
Logger l = logManager.getLogger(loggerName);
if (l == null) {
return null;
}
Level level = l.getLevel();
if (level == null) {
return EMPTY_STRING;
} else {
return level.getName();
}
|
public java.util.List | getLoggerNames()
Enumeration loggers = logManager.getLoggerNames();
ArrayList<String> array = new ArrayList<String>();
for (; loggers.hasMoreElements();) {
array.add((String) loggers.nextElement());
}
return array;
|
public java.lang.String | getParentLoggerName(java.lang.String loggerName)
Logger l = logManager.getLogger( loggerName );
if (l == null) {
return null;
}
Logger p = l.getParent();
if (p == null) {
// root logger
return EMPTY_STRING;
} else {
return p.getName();
}
|
public void | setLoggerLevel(java.lang.String loggerName, java.lang.String levelName)
if (loggerName == null) {
throw new NullPointerException("loggerName is null");
}
Logger logger = logManager.getLogger(loggerName);
if (logger == null) {
throw new IllegalArgumentException("Logger " + loggerName +
"does not exist");
}
Level level = null;
if (levelName != null) {
// parse will throw IAE if logLevel is invalid
level = Level.parse(levelName);
}
logger.setLevel(level);
|