|
Log4j 1.2.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log4j.LogManager
Use the LogManager
to retreive instances of Logger
.
Field Summary | |
static String |
CONFIGURATOR_CLASS_KEY
This string constant is set to log4j.configuratorClass. |
static String |
DEFAULT_CONFIGURATION_FILE
This string constant is set to log4j.properties the name of the file that will be searched by default in classpath. |
static String |
DEFAULT_CONFIGURATION_KEY
This string constant is set to log4j.configuration. |
static String |
DEFAULT_INIT_OVERRIDE_KEY
Setting the system property log4j.defaultInitOverride to "true" or any other value than "false" will skip default configuration process. |
Constructor Summary | |
LogManager()
|
Method Summary | |
static Logger |
exists(String name)
|
static Enumeration |
getCurrentLoggers()
|
static Logger |
getLogger(Class clazz)
Retrieve the appropriate Logger instance. |
static Logger |
getLogger(String name)
Retrieve the appropriate Logger instance. |
static Logger |
getLogger(String name,
LoggerFactory factory)
Retrieve the appropriate Logger instance. |
static LoggerRepository |
getLoggerRepository()
|
static Logger |
getRootLogger()
Retrieve the appropriate root logger. |
static void |
resetConfiguration()
|
static void |
setRepositorySelector(RepositorySelector selector,
Object guard)
Sets LoggerFactory 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 String DEFAULT_CONFIGURATION_FILE
PropertyConfigurator
.
See also DEFAULT_CONFIGURATION_KEY
for a more general
alternative.
See also the full description of default intialization procedure.
public static final String DEFAULT_CONFIGURATION_KEY
It corresponds to name of a system property that, if set,
specifies the name of the resource containing the properties file
or URL
with which log4j should configure itself. See
OptionConverter.selectAndConfigure(java.net.URL, java.lang.String, org.apache.log4j.spi.LoggerRepository)
for more detailed
information on the processing of this option.
Setting the log4j.configuration system property overrides the default search for the file log4j.properties.
Note that all property keys are case sensitive.
See also the full description of default intialization procedure.
public static final String CONFIGURATOR_CLASS_KEY
It corresponds to name of a system property that, if set,
specifies the class name to use to automatically configure
log4j. See OptionConverter.selectAndConfigure(java.net.URL, java.lang.String, org.apache.log4j.spi.LoggerRepository)
for more
detailed information on the processing of this option.
Setting the log4j.configuration system property overrides the default search for the file log4j.properties.
Note that all property keys are case sensitive.
See also the full description of default intialization procedure.
public static final String DEFAULT_INIT_OVERRIDE_KEY
The current value of the DEFAULT_INIT_OVERRIDE_KEY string constant is log4j.defaultInitOverride.
See also the full description of default intialization procedure.
Note that all property keys are case sensitive.
Constructor Detail |
public LogManager()
Method Detail |
public static void setRepositorySelector(RepositorySelector selector, Object guard) throws IllegalArgumentException
LoggerFactory
but 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 a IllegalArgumentException
, unless the previously set
guard
is passed as the second parameter.
This allows a high-level component to set the RepositorySelector
used by the LogManager
.
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.
public static LoggerRepository getLoggerRepository()
public static Logger getRootLogger()
public static Logger getLogger(String name)
Logger
instance.public static Logger getLogger(Class clazz)
Logger
instance.public static Logger getLogger(String name, LoggerFactory factory)
Logger
instance.public static Logger exists(String name)
public static Enumeration getCurrentLoggers()
public static void shutdown()
public static void resetConfiguration()
|
Log4j 1.2.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |