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 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.(package private) static final Stringprivate static final booleanprivate static RepositorySelector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanstatic LoggerTests if a logger for the given name exists.(package private) static Loggerexists(String name, ClassLoader classLoader) (package private) static LoggerContextgetContext(ClassLoader classLoader) Gets a LoggerContext.static EnumerationGets an enumeration of the current loggers.(package private) static EnumerationgetCurrentLoggers(ClassLoader classLoader) (package private) static Hierarchystatic LoggerGets the logger for the given class.static LoggerGets the logger for the given name.(package private) static LoggergetLogger(String name, ClassLoader classLoader) static LoggergetLogger(String name, LoggerFactory factory) (package private) static LoggergetLogger(String name, LoggerFactory factory, ClassLoader classLoader) static LoggerRepositorystatic LoggerGets the root logger.(package private) static LoggergetRootLogger(ClassLoader classLoader) (package private) static boolean(package private) static voidreconfigure(ClassLoader classLoader) static void(package private) static voidresetConfiguration(ClassLoader classLoader) static voidsetRepositorySelector(RepositorySelector selector, Object guard) static voidshutdown()Shuts down the current configuration.(package private) static voidshutdown(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
-