org.apache.log4j
Class Logger
- AppenderAttachable
This is the central class in the log4j package. Most logging
operations, except configuration, are done through this class.
- Ceki Gülcü
- log4j 1.2
addAppender , assertLog , callAppenders , debug , debug , error , error , exists , fatal , fatal , forcedLog , getAdditivity , getAllAppenders , getAppender , getChainedPriority , getCurrentCategories , getDefaultHierarchy , getEffectiveLevel , getHierarchy , getInstance , getInstance , getLevel , getLoggerRepository , getName , getParent , getPriority , getResourceBundle , getResourceBundleString , getRoot , info , info , isAttached , isDebugEnabled , isEnabledFor , isInfoEnabled , l7dlog , l7dlog , log , log , log , removeAllAppenders , removeAppender , removeAppender , setAdditivity , setLevel , setPriority , setResourceBundle , shutdown , warn , warn |
Logger
protected Logger(String name)
getLogger
public static Logger getLogger(Class clazz)
Shorthand for getLogger(clazz.getName())
.
clazz
- The name of clazz
will be used as the
name of the logger to retrieve. See getLogger(String)
for more detailed information.
getLogger
public static Logger getLogger(String name)
Retrieve a logger named according to the value of the
name
parameter. If the named logger already exists,
then the existing instance will be returned. Otherwise, a new
instance is created.
By default, loggers do not have a set level but inherit it
from their neareast ancestor with a set level. This is one of the
central features of log4j.
name
- The name of the logger to retrieve.
getLogger
public static Logger getLogger(String name,
LoggerFactory factory)
name
- The name of the logger to retrieve.factory
- A LoggerFactory
implementation that will
actually create a new Instance.
- 0.8.5
getRootLogger
public static Logger getRootLogger()
Return the root logger for the current logger repository.
The
Logger.getName()
method for the root logger always returns
stirng value: "root". However, calling
Logger.getLogger("root")
does not retrieve the root
logger but a logger just under root named "root".
In other words, calling this method is the only way to retrieve the
root logger.
Copyright 2000-2002 Apache Software Foundation.