Class AbstractLogger
- java.lang.Object
-
- org.slf4j.helpers.AbstractLogger
-
- All Implemented Interfaces:
java.io.Serializable,Logger
- Direct Known Subclasses:
LegacyAbstractLogger
public abstract class AbstractLogger extends java.lang.Object implements Logger, java.io.Serializable
An abstract implementation which delegates actual logging work to thehandleNormalizedLoggingCall(Level, Marker, String, Object[], Throwable)method.- Since:
- 2.0
- Author:
- Ceki Gülcü
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringname-
Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractLogger()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.String msg)Log a message at the DEBUG level.voiddebug(java.lang.String format, java.lang.Object arg)Log a message at the DEBUG level according to the specified format and argument.voiddebug(java.lang.String format, java.lang.Object... arguments)Log a message at the DEBUG level according to the specified format and arguments.voiddebug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the DEBUG level according to the specified format and arguments.voiddebug(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the DEBUG level with an accompanying message.voiddebug(Marker marker, java.lang.String msg)Log a message with the specific Marker at the DEBUG level.voiddebug(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration.voiddebug(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration.voiddebug(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.debug(String, Object, Object)method except that the marker data is also taken into consideration.voiddebug(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration.voiderror(java.lang.String msg)Log a message at the ERROR level.voiderror(java.lang.String format, java.lang.Object arg)Log a message at the ERROR level according to the specified format and argument.voiderror(java.lang.String format, java.lang.Object... arguments)Log a message at the ERROR level according to the specified format and arguments.voiderror(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the ERROR level according to the specified format and arguments.voiderror(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the ERROR level with an accompanying message.voiderror(Marker marker, java.lang.String msg)Log a message with the specific Marker at the ERROR level.voiderror(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration.voiderror(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration.voiderror(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.error(String, Object, Object)method except that the marker data is also taken into consideration.voiderror(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration.protected abstract java.lang.StringgetFullyQualifiedCallerName()java.lang.StringgetName()Return the name of thisLoggerinstance.protected abstract voidhandleNormalizedLoggingCall(Level level, Marker marker, java.lang.String messagePattern, java.lang.Object[] arguments, java.lang.Throwable throwable)Given various arguments passed as parameters, perform actual logging.voidinfo(java.lang.String msg)Log a message at the INFO level.voidinfo(java.lang.String format, java.lang.Object arg)Log a message at the INFO level according to the specified format and argument.voidinfo(java.lang.String format, java.lang.Object... arguments)Log a message at the INFO level according to the specified format and arguments.voidinfo(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the INFO level according to the specified format and arguments.voidinfo(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the INFO level with an accompanying message.voidinfo(Marker marker, java.lang.String msg)Log a message with the specific Marker at the INFO level.voidinfo(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration.voidinfo(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration.voidinfo(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.info(String, Object, Object)method except that the marker data is also taken into consideration.voidinfo(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration.protected java.lang.ObjectreadResolve()Replace this instance with a homonymous (same name) logger returned by LoggerFactory.voidtrace(java.lang.String msg)Log a message at the TRACE level.voidtrace(java.lang.String format, java.lang.Object arg)Log a message at the TRACE level according to the specified format and argument.voidtrace(java.lang.String format, java.lang.Object... arguments)Log a message at the TRACE level according to the specified format and arguments.voidtrace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the TRACE level according to the specified format and arguments.voidtrace(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the TRACE level with an accompanying message.voidtrace(Marker marker, java.lang.String msg)Log a message with the specific Marker at the TRACE level.voidtrace(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration.voidtrace(Marker marker, java.lang.String format, java.lang.Object... argArray)This method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration.voidtrace(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.trace(String, Object, Object)method except that the marker data is also taken into consideration.voidtrace(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration.voidwarn(java.lang.String msg)Log a message at the WARN level.voidwarn(java.lang.String format, java.lang.Object arg)Log a message at the WARN level according to the specified format and argument.voidwarn(java.lang.String format, java.lang.Object... arguments)Log a message at the WARN level according to the specified format and arguments.voidwarn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the WARN level according to the specified format and arguments.voidwarn(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the WARN level with an accompanying message.voidwarn(Marker marker, java.lang.String msg)Log a message with the specific Marker at the WARN level.voidwarn(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration.voidwarn(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration.voidwarn(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.warn(String, Object, Object)method except that the marker data is also taken into consideration.voidwarn(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.slf4j.Logger
atDebug, atError, atInfo, atLevel, atTrace, atWarn, isDebugEnabled, isDebugEnabled, isEnabledForLevel, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, makeLoggingEventBuilder
-
-
-
-
Field Detail
-
name
protected java.lang.String name
-
-
Constructor Detail
-
AbstractLogger
public AbstractLogger()
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:LoggerReturn the name of thisLoggerinstance.
-
readResolve
protected java.lang.Object readResolve() throws java.io.ObjectStreamException
Replace this instance with a homonymous (same name) logger returned by LoggerFactory. Note that this method is only called during deserialization.This approach will work well if the desired ILoggerFactory is the one referenced by
LoggerFactoryHowever, if the user manages its logger hierarchy through a different (non-static) mechanism, e.g. dependency injection, then this approach would be mostly counterproductive.- Returns:
- logger with same name as returned by LoggerFactory
- Throws:
java.io.ObjectStreamException
-
trace
public void trace(java.lang.String msg)
Description copied from interface:LoggerLog a message at the TRACE level.
-
trace
public void trace(java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the TRACE level.
-
trace
public void trace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the TRACE level.
-
trace
public void trace(java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the TRACE level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for TRACE. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost.
-
trace
public void trace(java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerLog an exception (throwable) at the TRACE level with an accompanying message.
-
trace
public void trace(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the TRACE level.
-
trace
public void trace(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration.
-
trace
public void trace(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object, Object)method except that the marker data is also taken into consideration.
-
trace
public void trace(Marker marker, java.lang.String format, java.lang.Object... argArray)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration.
-
trace
public void trace(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration.
-
debug
public void debug(java.lang.String msg)
Description copied from interface:LoggerLog a message at the DEBUG level.
-
debug
public void debug(java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the DEBUG level.
-
debug
public void debug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the DEBUG level.
-
debug
public void debug(java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the DEBUG level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for DEBUG. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost.
-
debug
public void debug(java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerLog an exception (throwable) at the DEBUG level with an accompanying message.
-
debug
public void debug(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the DEBUG level.
-
debug
public void debug(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration.
-
debug
public void debug(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object, Object)method except that the marker data is also taken into consideration.
-
debug
public void debug(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration.
-
debug
public void debug(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration.
-
info
public void info(java.lang.String msg)
Description copied from interface:LoggerLog a message at the INFO level.
-
info
public void info(java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerLog a message at the INFO level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the INFO level.
-
info
public void info(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerLog a message at the INFO level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the INFO level.
-
info
public void info(java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerLog a message at the INFO level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the INFO level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for INFO. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost.
-
info
public void info(java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerLog an exception (throwable) at the INFO level with an accompanying message.
-
info
public void info(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the INFO level.
-
info
public void info(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration.
-
info
public void info(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object, Object)method except that the marker data is also taken into consideration.
-
info
public void info(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration.
-
info
public void info(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration.
-
warn
public void warn(java.lang.String msg)
Description copied from interface:LoggerLog a message at the WARN level.
-
warn
public void warn(java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerLog a message at the WARN level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the WARN level.
-
warn
public void warn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerLog a message at the WARN level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the WARN level.
-
warn
public void warn(java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerLog a message at the WARN level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the WARN level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for WARN. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost.
-
warn
public void warn(java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerLog an exception (throwable) at the WARN level with an accompanying message.
-
warn
public void warn(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the WARN level.
-
warn
public void warn(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration.
-
warn
public void warn(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object, Object)method except that the marker data is also taken into consideration.
-
warn
public void warn(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration.
-
warn
public void warn(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration.
-
error
public void error(java.lang.String msg)
Description copied from interface:LoggerLog a message at the ERROR level.
-
error
public void error(java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the ERROR level.
-
error
public void error(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the ERROR level.
-
error
public void error(java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the ERROR level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for ERROR. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost.
-
error
public void error(java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerLog an exception (throwable) at the ERROR level with an accompanying message.
-
error
public void error(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the ERROR level.
-
error
public void error(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration.
-
error
public void error(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object, Object)method except that the marker data is also taken into consideration.
-
error
public void error(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration.
-
error
public void error(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration.
-
getFullyQualifiedCallerName
protected abstract java.lang.String getFullyQualifiedCallerName()
-
handleNormalizedLoggingCall
protected abstract void handleNormalizedLoggingCall(Level level, Marker marker, java.lang.String messagePattern, java.lang.Object[] arguments, java.lang.Throwable throwable)
Given various arguments passed as parameters, perform actual logging.This method assumes that the separation of the args array into actual objects and a throwable has been already operated.
- Parameters:
level- the SLF4J level for this eventmarker- The marker to be used for this event, may be null.messagePattern- The message pattern which will be parsed and formattedarguments- the array of arguments to be formatted, may be nullthrowable- The exception whose stack trace should be logged, may be null
-
-