Package org.apache.log4j
Class LogManager
java.lang.Object
org.apache.log4j.LogManager
The main entry point to Log4j 1.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.This variable is for internal use only.static final String
Deprecated.This variable is for internal use only.static final String
Deprecated.This variable is for internal use only.static final String
Deprecated.This variable is for internal use only.(package private) static final String
private static final boolean
private static RepositorySelector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
static Logger
Tests if a logger for the given name exists.(package private) static Logger
exists
(String name, ClassLoader classLoader) (package private) static LoggerContext
getContext
(ClassLoader classLoader) Gets a LoggerContext.static Enumeration
Gets an enumeration of the current loggers.(package private) static Enumeration
getCurrentLoggers
(ClassLoader classLoader) (package private) static Hierarchy
static Logger
Gets the logger for the given class.static Logger
Gets the logger for the given name.(package private) static Logger
getLogger
(String name, ClassLoader classLoader) static Logger
getLogger
(String name, LoggerFactory factory) (package private) static Logger
getLogger
(String name, LoggerFactory factory, ClassLoader classLoader) static LoggerRepository
static Logger
Gets the root logger.(package private) static Logger
getRootLogger
(ClassLoader classLoader) (package private) static boolean
(package private) static void
reconfigure
(ClassLoader classLoader) static void
(package private) static void
resetConfiguration
(ClassLoader classLoader) static void
setRepositorySelector
(RepositorySelector selector, Object guard) static void
shutdown()
Shuts down the current configuration.(package private) static void
shutdown
(ClassLoader classLoader)
-
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:
-
DEFAULT_XML_CONFIGURATION_FILE
- See Also:
-
repositorySelector
-
LOG4J_CORE_PRESENT
private static final boolean LOG4J_CORE_PRESENT
-
-
Constructor Details
-
LogManager
public LogManager()
-
-
Method Details
-
checkLog4jCore
private static boolean checkLog4jCore() -
exists
Tests if a logger for the given name exists.- Parameters:
name
- logger name to test.- Returns:
- whether a logger for the given name exists.
-
exists
-
getContext
Gets a LoggerContext.- Parameters:
loader
- The ClassLoader for the context. If null the context will attempt to determine the appropriate ClassLoader.- Returns:
- a LoggerContext.
-
getCurrentLoggers
Gets an enumeration of the current loggers.- Returns:
- an enumeration of the current loggers.
-
getCurrentLoggers
-
getHierarchy
-
getLogger
Gets the logger for the given class. -
getLogger
Gets the logger for the given name. -
getLogger
-
getLogger
-
getLogger
-
getLoggerRepository
-
getRootLogger
Gets the root logger. -
getRootLogger
-
isLog4jCorePresent
static boolean isLog4jCorePresent() -
reconfigure
-
resetConfiguration
public static void resetConfiguration() -
resetConfiguration
-
setRepositorySelector
public static void setRepositorySelector(RepositorySelector selector, Object guard) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
shutdown
public static void shutdown()Shuts down the current configuration. -
shutdown
-