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.
- Author:
- Sébastien Pennec, Ceki Gülcü
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAppender(Appender newAppender) voidprotected final StringconvertToString(Object message) voidDelegates toLogger.debug(String)method of SLF4J.voidDelegates toLogger.debug(String,Throwable)method in SLF4J.voidDelegates toLogger.error(String)method in SLF4J.voidDelegates toLogger.error(String,Throwable)method in SLF4J.voidDelegates toLogger.error(String)method in SLF4J.voidDelegates toLogger.error(String,Throwable)method in SLF4J.protected voidbooleangetAppender(String name) Return the level in effect for this category/logger.static CategorygetInstance(Class clazz) static CategorygetInstance(String name) final LevelgetLevel()Returns the assignedLevel, if any, for this Category.getName()Returns the obvious.final Categoryfinal LevelDeprecated.voidDelegates toLogger.info(String)method in SLF4J.voidDelegates toLogger.info(String,Throwable)method in SLF4J.booleanDelegates toLogger.isDebugEnabled()method in SLF4JbooleanDetermines whether the priority passed as parameter is enabled in the underlying SLF4J logger.booleanDelegates toLogger.isErrorEnabled()method in SLF4JbooleanDelegates toLogger.isInfoEnabled()method in SLF4JbooleanDelegates toLogger.isWarnEnabled()method in SLF4JvoidvoidvoidvoidsetAdditivity(boolean additive) voidvoidDelegates toLogger.warn(String)method in SLF4J.voidDelegates toLogger.warn(String,Throwable)method in SLF4J.
-
Field Details
-
slf4jLogger
-
-
Method Details
-
getInstance
-
getInstance
-
getParent
-
getName
-
getAppender
-
getAllAppenders
-
getEffectiveLevel
Return the level in effect for this category/logger.The result is computed by simulation.
- Returns:
-
getLevel
-
getPriority
-
isDebugEnabled
Delegates toLogger.isDebugEnabled()method in SLF4J- Returns:
- true if this logger is enabled for the level DEBUG
-
isInfoEnabled
Delegates toLogger.isInfoEnabled()method in SLF4J- Returns:
- true if this logger is enabled for the level INFO
-
isWarnEnabled
Delegates toLogger.isWarnEnabled()method in SLF4J- Returns:
- true if this logger is enabled for the level WARN
-
isErrorEnabled
Delegates toLogger.isErrorEnabled()method in SLF4J- Returns:
- true if this logger is enabled for the level ERROR
-
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.
-
debug
Delegates toLogger.debug(String)method of SLF4J.- Parameters:
message- a message to log
-
debug
Delegates toLogger.debug(String,Throwable)method in SLF4J.- Parameters:
message- a message to logt- a throwable to log
-
info
Delegates toLogger.info(String)method in SLF4J.- Parameters:
message- a message to log
-
info
Delegates toLogger.info(String,Throwable)method in SLF4J.- Parameters:
message- a message to logt- a throwable to log
-
warn
Delegates toLogger.warn(String)method in SLF4J.- Parameters:
message- a message to log
-
warn
Delegates toLogger.warn(String,Throwable)method in SLF4J.- Parameters:
message- a message to logt- a throwable to log
-
error
Delegates toLogger.error(String)method in SLF4J.- Parameters:
message- a message to log
-
error
Delegates toLogger.error(String,Throwable)method in SLF4J.- Parameters:
message- a message to logt- a throwable to log
-
fatal
Delegates toLogger.error(String)method in SLF4J.- Parameters:
message- a message to log
-
fatal
Delegates toLogger.error(String,Throwable)method in SLF4J. In addition, the call is marked with a marker named "FATAL".- Parameters:
message- a message to logt- a throwable to log
-
forcedLog
-
log
-
log
-
log
-
convertToString
-
setAdditivity
-
addAppender
-
setLevel
-
getAdditivity
-
assertLog
-
getLevel()instead.