Methods Summary |
---|
public static org.apache.log4j.Logger | getLogger(java.lang.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.
return LogManager.getLogger(name);
|
public static org.apache.log4j.Logger | getLogger(java.lang.Class clazz)Shorthand for getLogger(clazz.getName()) .
return LogManager.getLogger(clazz.getName());
|
public static org.apache.log4j.Logger | getLogger(java.lang.String name, org.apache.log4j.spi.LoggerFactory factory)Like {@link #getLogger(String)} except that the type of logger
instantiated depends on the type returned by the {@link
LoggerFactory#makeNewLoggerInstance} method of the
factory parameter.
This method is intended to be used by sub-classes.
return LogManager.getLogger(name, factory);
|
public static org.apache.log4j.Logger | getRootLogger()Return the root logger for the current logger repository.
The {@link #getName 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.
return LogManager.getRootLogger();
|
public boolean | isTraceEnabled()Check whether this category is enabled for the TRACE Level.
if (repository.isDisabled(Level.TRACE_INT)) {
return false;
}
return Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel());
|
public void | trace(java.lang.Object message)Log a message object with the {@link org.apache.log4j.Level#TRACE TRACE} level.
if (repository.isDisabled(Level.TRACE_INT)) {
return;
}
if (Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel())) {
forcedLog(FQCN, Level.TRACE, message, null);
}
|
public void | trace(java.lang.Object message, java.lang.Throwable t)Log a message object with the TRACE level including the
stack trace of the {@link Throwable}t passed as parameter.
See {@link #debug(Object)} form for more detailed information.
if (repository.isDisabled(Level.TRACE_INT)) {
return;
}
if (Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel())) {
forcedLog(FQCN, Level.TRACE, message, t);
}
|