public class Log4jConfigurator extends Object
SYS_PROP_SHOW_ALL| Modifier and Type | Field and Description |
|---|---|
static String |
SYS_PROP_SHOW_ALL
Name of the "show all loggers" system property.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAppenders(String logger)
Gets the appenders to a specific logger.
|
org.apache.log4j.Level |
getEffectiveLevel(String logger)
Gets a logger's effective level thus either the direct level or the inherited level from it's parent logger.
|
static Log4jConfigurator |
getInstance()
Gets the one-and-only instance of the class
Log4jConfigurator. |
org.apache.log4j.Level |
getLevel(String logger)
Gets a logger's actual level.
|
List<String> |
getLoggers()
Retrieves all loggers from the log4j repository.
|
List<String> |
getLoggersSorted()
Retrieves all loggers from the log4j repository.
|
void |
setLoggerLevel(String logger,
String level)
Sets or deletes a logger's new level.
|
public static final String SYS_PROP_SHOW_ALL
public static Log4jConfigurator getInstance()
Log4jConfigurator.public List<String> getLoggers()
java.lang.String containing all logger names.SYS_PROP_SHOW_ALLpublic List<String> getLoggersSorted()
java.lang.String containing all logger names.SYS_PROP_SHOW_ALLpublic List<String> getAppenders(String logger) throws IllegalArgumentException
logger - A logger's name.java.lang.String containing all appender names.IllegalArgumentException - In case the logger isn't known.public org.apache.log4j.Level getLevel(String logger) throws IllegalArgumentException
logger - The logger.null if no level was directly set on the logger.IllegalArgumentException - In case the logger isn't known.public org.apache.log4j.Level getEffectiveLevel(String logger) throws IllegalArgumentException
logger - The logger.IllegalArgumentException - In case the logger isn't known.public void setLoggerLevel(String logger, String level) throws IllegalArgumentException
logger - Name of the logger to set.level - Level to set the logger to.IllegalArgumentException - In case the logger isn't known.Copyright © 2016–2018. All rights reserved.