Package org.apache.log4j
Class LogManager
java.lang.Object
org.apache.log4j.LogManager
Use the
LogManager class to retreive Logger instances or to operate on the current
LoggerRepository. When the
LogManager class is loaded into memory the default initalzation
procedure is inititated. The default intialization procedure is described in the short log4j manual.- Author:
- Ceki Gülcü
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.This variable is for internal use only.static final StringDeprecated.This variable is for internal use only.static final StringDeprecated.This variable is for internal use only.static final StringDeprecated.This variable is for internal use only. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Loggerstatic Enumerationstatic LoggerRetrieve the appropriateLoggerinstance.static LoggerRetrieve the appropriateLoggerinstance.static LoggergetLogger(String name, LoggerFactory factory) Retrieve the appropriateLoggerinstance.static LoggerRepositorystatic LoggerRetrieve the appropriate root logger.static voidstatic voidsetRepositorySelector(RepositorySelector selector, Object guard) SetsLoggerFactorybut only if the correct guard is passed as parameter.static voidshutdown()
-
Field Details
-
DEFAULT_CONFIGURATION_FILE
Deprecated.This variable is for internal use only. It will become package protected in future versions.- See Also:
-
DEFAULT_CONFIGURATION_KEY
Deprecated.This variable is for internal use only. It will become private in future versions.- See Also:
-
CONFIGURATOR_CLASS_KEY
Deprecated.This variable is for internal use only. It will become private in future versions.- See Also:
-
DEFAULT_INIT_OVERRIDE_KEY
Deprecated.This variable is for internal use only. It will become private in future versions.- See Also:
-
-
Constructor Details
-
LogManager
public LogManager()
-
-
Method Details
-
setRepositorySelector
public static void setRepositorySelector(RepositorySelector selector, Object guard) throws IllegalArgumentException SetsLoggerFactorybut only if the correct guard is passed as parameter.Initally the guard is null. If the guard is
null, then invoking this method sets the logger factory and the guard. Following invocations will throw aIllegalArgumentException, unless the previously setguardis passed as the second parameter.This allows a high-level component to set the
RepositorySelectorused by theLogManager.For example, when tomcat starts it will be able to install its own repository selector. However, if and when Tomcat is embedded within JBoss, then JBoss will install its own repository selector and Tomcat will use the repository selector set by its container, JBoss.
- Throws:
IllegalArgumentException
-
getLoggerRepository
-
getRootLogger
Retrieve the appropriate root logger. -
getLogger
Retrieve the appropriateLoggerinstance. -
getLogger
Retrieve the appropriateLoggerinstance. -
getLogger
Retrieve the appropriateLoggerinstance. -
exists
-
getCurrentLoggers
-
shutdown
public static void shutdown() -
resetConfiguration
public static void resetConfiguration()
-