Package org.apache.log4j
Class Category
java.lang.Object
org.apache.log4j.Category
- Direct Known Subclasses:
Logger
This class is a minimal implementation of the original
org.apache.log4j.Category
class (as found in log4j 1.2) by
delegation of all calls to a Logger
instance.
Log4j's trace
, debug()
, info()
,
warn()
, error()
printing methods are directly
mapped to their SLF4J equivalents. Log4j's fatal()
printing
method is mapped to SLF4J's error()
method with a FATAL marker.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static Marker
private LocationAwareLogger
private String
protected Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAppender
(Appender newAppender) void
protected final String
convertToString
(Object message) void
Delegates toLogger.debug(String)
method of SLF4J.void
Delegates toLogger.debug(String,Throwable)
method in SLF4J.(package private) void
differentiatedLog
(Marker marker, String fqcn, int level, Object message, Throwable t) void
Delegates toLogger.error(String)
method in SLF4J.void
Delegates toLogger.error(String,Throwable)
method in SLF4J.void
Delegates toLogger.error(String)
method in SLF4J.void
Delegates toLogger.error(String,Throwable)
method in SLF4J.protected void
boolean
getAppender
(String name) Return the level in effect for this category/logger.static Category
getInstance
(Class clazz) static Category
getInstance
(String name) final Level
getLevel()
Returns the assignedLevel
, if any, for this Category.getName()
Returns the obvious.final Category
final Level
Deprecated.void
Delegates toLogger.info(String)
method in SLF4J.void
Delegates toLogger.info(String,Throwable)
method in SLF4J.boolean
Delegates toLogger.isDebugEnabled()
method in SLF4Jboolean
Determines whether the priority passed as parameter is enabled in the underlying SLF4J logger.boolean
Delegates toLogger.isErrorEnabled()
method in SLF4Jboolean
Delegates toLogger.isInfoEnabled()
method in SLF4Jboolean
Delegates toLogger.isWarnEnabled()
method in SLF4Jvoid
void
void
private int
void
setAdditivity
(boolean additive) void
void
Delegates toLogger.warn(String)
method in SLF4J.void
Delegates toLogger.warn(String,Throwable)
method in SLF4J.
-
Field Details
-
CATEGORY_FQCN
-
name
-
slf4jLogger
-
locationAwareLogger
-
FATAL_MARKER
-
-
Constructor Details
-
Category
Category(String name)
-
-
Method Details
-
getInstance
-
getInstance
-
getParent
-
getName
Returns the obvious.- Returns:
-
getAppender
-
getAllAppenders
-
getEffectiveLevel
Return the level in effect for this category/logger.The result is computed by simulation.
- Returns:
-
getLevel
Returns the assignedLevel
, if any, for this Category. This implementation always returns null.- Returns:
- Level - the assigned Level, can be
null
.
-
getPriority
Deprecated.Please usegetLevel()
instead. -
isDebugEnabled
public boolean isDebugEnabled()Delegates toLogger.isDebugEnabled()
method in SLF4J -
isInfoEnabled
public boolean isInfoEnabled()Delegates toLogger.isInfoEnabled()
method in SLF4J -
isWarnEnabled
public boolean isWarnEnabled()Delegates toLogger.isWarnEnabled()
method in SLF4J -
isErrorEnabled
public boolean isErrorEnabled()Delegates toLogger.isErrorEnabled()
method in SLF4J -
isEnabledFor
Determines whether the priority passed as parameter is enabled in the underlying SLF4J logger. Each log4j priority is mapped directly to its SLF4J equivalent, except for FATAL which is mapped as ERROR.- Parameters:
p
- the priority to check against- Returns:
- true if this logger is enabled for the given level, false otherwise.
-
differentiatedLog
-
debug
Delegates toLogger.debug(String)
method of SLF4J. -
debug
Delegates toLogger.debug(String,Throwable)
method in SLF4J. -
info
Delegates toLogger.info(String)
method in SLF4J. -
info
Delegates toLogger.info(String,Throwable)
method in SLF4J. -
warn
Delegates toLogger.warn(String)
method in SLF4J. -
warn
Delegates toLogger.warn(String,Throwable)
method in SLF4J. -
error
Delegates toLogger.error(String)
method in SLF4J. -
error
Delegates toLogger.error(String,Throwable)
method in SLF4J. -
fatal
Delegates toLogger.error(String)
method in SLF4J. -
fatal
Delegates toLogger.error(String,Throwable)
method in SLF4J. In addition, the call is marked with a marker named "FATAL". -
forcedLog
-
log
-
log
-
log
-
priorityToLevelInt
-
convertToString
-
setAdditivity
public void setAdditivity(boolean additive) -
addAppender
-
setLevel
-
getAdditivity
public boolean getAdditivity() -
assertLog
-
getLevel()
instead.