|
Log4j 1.3alpha-6 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Field Summary | |
static LoggerRepository |
defaultLoggerRepository
The default LoggerRepository instance created by LogManager. |
static SimpleLoggerFA |
SIMPLE_LOGGER_FA
Log4j components resort to this instance of SimpleLoggerFA in case
an appropriate LoggerRepository was not set or could not be found. |
Constructor Summary | |
LogManager()
|
Method Summary | |
static Logger |
exists(java.lang.String name)
|
static java.util.Enumeration |
getCurrentLoggers()
|
static Logger |
getLogger(java.lang.Class clazz)
Retrieve the appropriate Logger instance. |
static Logger |
getLogger(java.lang.String name)
Retrieve the appropriate Logger instance. |
static Logger |
getLogger(java.lang.String name,
LoggerFactory factory)
Retrieve the appropriate Logger instance. |
static LoggerRepository |
getLoggerRepository()
|
static RepositorySelector |
getRepositorySelector()
Return the repository selector currently in use. |
static Logger |
getRootLogger()
Retrieve the appropriate root logger. |
static void |
resetConfiguration()
|
static void |
setRepositorySelector(RepositorySelector selector,
java.lang.Object guard)
Sets RepositorySelector but only if the correct
guard is passed as parameter.
|
static void |
shutdown()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final LoggerRepository defaultLoggerRepository
RepositorySelector
instance.
The selector, if it choses, may ignore this default repository.
public static final SimpleLoggerFA SIMPLE_LOGGER_FA
SimpleLoggerFA
in case
an appropriate LoggerRepository was not set or could not be found. It is
used only in exceptional cases.
Constructor Detail |
public LogManager()
Method Detail |
public static void setRepositorySelector(RepositorySelector selector, java.lang.Object guard) throws java.lang.IllegalArgumentException
RepositorySelector
but only if the correct
guard is passed as parameter.
Initally the guard is null, unless the JVM is started with the
log4j.repositorySelector system property
(-Dlog4j.repositorySelector=[JNDI | This allows a high-level component to set the 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.
null
, then invoking this method sets the logger
repository and the guard. Following invocations will throw a IllegalArgumentException
, unless the previously set
guard
is passed as the second parameter.
RepositorySelector
used by the LogManager
.
java.lang.IllegalArgumentException
public static RepositorySelector getRepositorySelector()
RepositorySelector
currently in use.public static LoggerRepository getLoggerRepository()
public static Logger getRootLogger()
public static Logger getLogger(java.lang.String name)
Logger
instance.
public static Logger getLogger(java.lang.Class clazz)
Logger
instance.
public static Logger getLogger(java.lang.String name, LoggerFactory factory)
Logger
instance.
public static Logger exists(java.lang.String name)
public static java.util.Enumeration getCurrentLoggers()
public static void shutdown()
public static void resetConfiguration()
|
Log4j 1.3alpha-6 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |