Package org.slf4j.log4j12
Class Log4jLoggerAdapter
java.lang.Object
org.slf4j.helpers.AbstractLogger
org.slf4j.helpers.LegacyAbstractLogger
org.slf4j.log4j12.Log4jLoggerAdapter
- All Implemented Interfaces:
Serializable,Logger,LocationAwareLogger,LoggingEventAware
public final class Log4jLoggerAdapter
extends LegacyAbstractLogger
implements LocationAwareLogger, LoggingEventAware, Serializable
A wrapper over
org.apache.log4j.Logger in
conforming to the Logger interface.
Note that the logging levels mentioned in this class refer to those defined
in the
org.apache.log4j.Level class.
The TRACE level was introduced in log4j version 1.2.12. In order to avoid crashing the host application, in the case the log4j version in use predates 1.2.12, the TRACE level will be mapped as DEBUG. See also SLF4J-59.
- Author:
- Ceki Gülcü
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.slf4j.helpers.AbstractLogger
nameFields inherited from interface org.slf4j.spi.LocationAwareLogger
DEBUG_INT, ERROR_INT, INFO_INT, TRACE_INT, WARN_INTFields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected voidhandleNormalizedLoggingCall(Level level, Marker marker, String msg, Object[] arguments, Throwable throwable)booleanIs this logger instance enabled for the DEBUG level?booleanIs this logger instance enabled for level ERROR?booleanIs this logger instance enabled for the INFO level?booleanIs this logger instance enabled for the TRACE level?booleanIs this logger instance enabled for the WARN level?voidlog(LoggingEvent event)Called bySubstituteLoggeror byLoggingEventBuilderinstancesvoidMethods inherited from class org.slf4j.helpers.LegacyAbstractLogger
isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabledMethods inherited from class org.slf4j.helpers.AbstractLogger
debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, error, error, getName, info, info, info, info, info, info, info, info, info, info, readResolve, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.slf4j.Logger
atDebug, atError, atInfo, atTrace, atWarn, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, error, error, getName, info, info, info, info, info, info, info, info, info, info, isDebugEnabled, isEnabledForLevel, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, makeLoggingEventBuilder, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn
-
Method Details
-
isTraceEnabled
public boolean isTraceEnabled()Is this logger instance enabled for the TRACE level?- Specified by:
isTraceEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for level TRACE, false otherwise.
-
isDebugEnabled
public boolean isDebugEnabled()Is this logger instance enabled for the DEBUG level?- Specified by:
isDebugEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for level DEBUG, false otherwise.
-
isInfoEnabled
public boolean isInfoEnabled()Is this logger instance enabled for the INFO level?- Specified by:
isInfoEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the INFO level, false otherwise.
-
isWarnEnabled
public boolean isWarnEnabled()Is this logger instance enabled for the WARN level?- Specified by:
isWarnEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the WARN level, false otherwise.
-
isErrorEnabled
public boolean isErrorEnabled()Is this logger instance enabled for level ERROR?- Specified by:
isErrorEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for level ERROR, false otherwise.
-
log
public void log(Marker marker, String callerFQCN, int level, String msg, Object[] arguments, Throwable t)- Specified by:
login interfaceLocationAwareLogger
-
handleNormalizedLoggingCall
protected void handleNormalizedLoggingCall(Level level, Marker marker, String msg, Object[] arguments, Throwable throwable)- Specified by:
handleNormalizedLoggingCallin classAbstractLogger
-
log
Called bySubstituteLoggeror byLoggingEventBuilderinstances- Specified by:
login interfaceLoggingEventAware- Parameters:
event-
-
getFullyQualifiedCallerName
- Specified by:
getFullyQualifiedCallerNamein classAbstractLogger
-