Package org.apache.log4j
Class LogManager
- java.lang.Object
-
- org.apache.log4j.LogManager
-
public final class LogManager extends Object
The main entry point to Log4j 1.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIGURATOR_CLASS_KEY
Deprecated.This variable is for internal use only.static String
DEFAULT_CONFIGURATION_FILE
Deprecated.This variable is for internal use only.static String
DEFAULT_CONFIGURATION_KEY
Deprecated.This variable is for internal use only.static String
DEFAULT_INIT_OVERRIDE_KEY
Deprecated.This variable is for internal use only.
-
Constructor Summary
Constructors Constructor Description LogManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Logger
exists(String name)
Tests if a logger for the given name exists.static Enumeration
getCurrentLoggers()
Gets an enumeration of the current loggers.static Logger
getLogger(Class<?> clazz)
Gets the logger for the given class.static Logger
getLogger(String name)
Gets the logger for the given name.static Logger
getLogger(String name, LoggerFactory factory)
static LoggerRepository
getLoggerRepository()
static Logger
getRootLogger()
Gets the root logger.static void
resetConfiguration()
static void
setRepositorySelector(RepositorySelector selector, Object guard)
static void
shutdown()
Shuts down the current configuration.
-
-
-
Field Detail
-
DEFAULT_CONFIGURATION_FILE
@Deprecated public static final String DEFAULT_CONFIGURATION_FILE
Deprecated.This variable is for internal use only. It will become package protected in future versions.- See Also:
- Constant Field Values
-
DEFAULT_CONFIGURATION_KEY
@Deprecated public static final String DEFAULT_CONFIGURATION_KEY
Deprecated.This variable is for internal use only. It will become private in future versions.- See Also:
- Constant Field Values
-
CONFIGURATOR_CLASS_KEY
@Deprecated public static final String CONFIGURATOR_CLASS_KEY
Deprecated.This variable is for internal use only. It will become private in future versions.- See Also:
- Constant Field Values
-
DEFAULT_INIT_OVERRIDE_KEY
@Deprecated public static final String DEFAULT_INIT_OVERRIDE_KEY
Deprecated.This variable is for internal use only. It will become private in future versions.- See Also:
- Constant Field Values
-
-
Method Detail
-
exists
public static Logger exists(String name)
Tests if a logger for the given name exists.- Parameters:
name
- logger name to test.- Returns:
- whether a logger for the given name exists.
-
getCurrentLoggers
public static Enumeration getCurrentLoggers()
Gets an enumeration of the current loggers.- Returns:
- an enumeration of the current loggers.
-
getLogger
public static Logger getLogger(String name, LoggerFactory factory)
-
getLoggerRepository
public static LoggerRepository getLoggerRepository()
-
getRootLogger
public static Logger getRootLogger()
Gets the root logger.
-
resetConfiguration
public static void resetConfiguration()
-
setRepositorySelector
public static void setRepositorySelector(RepositorySelector selector, Object guard) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
shutdown
public static void shutdown()
Shuts down the current configuration.
-
-