Package ch.qos.logback.classic
Class Logger
java.lang.Object
ch.qos.logback.classic.Logger
- All Implemented Interfaces:
AppenderAttachable<ILoggingEvent>
,Serializable
,org.slf4j.Logger
,org.slf4j.spi.LocationAwareLogger
public final class Logger
extends Object
implements org.slf4j.Logger, org.slf4j.spi.LocationAwareLogger, AppenderAttachable<ILoggingEvent>, Serializable
- See Also:
-
Field Summary
Fields inherited from interface org.slf4j.spi.LocationAwareLogger
DEBUG_INT, ERROR_INT, INFO_INT, TRACE_INT, WARN_INT
Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAppender
(Appender<ILoggingEvent> newAppender) void
callAppenders
(ILoggingEvent event) Invoke all the appenders of this logger.void
void
void
void
void
void
void
void
void
void
void
Remove all previously added appenders from this logger instance.boolean
detachAppender
(Appender<ILoggingEvent> appender) Remove the appender passed as parameter form the list of appenders.boolean
detachAppender
(String name) void
void
void
void
void
void
void
void
void
void
getAppender
(String name) getLevel()
Return the context for this logger.getName()
void
void
void
void
void
void
void
void
void
void
boolean
boolean
isAttached
(Appender<ILoggingEvent> appender) boolean
boolean
isDebugEnabled
(org.slf4j.Marker marker) boolean
isEnabledFor
(Level level) boolean
isEnabledFor
(org.slf4j.Marker marker, Level level) boolean
boolean
isErrorEnabled
(org.slf4j.Marker marker) boolean
boolean
isInfoEnabled
(org.slf4j.Marker marker) boolean
boolean
isTraceEnabled
(org.slf4j.Marker marker) boolean
boolean
isWarnEnabled
(org.slf4j.Marker marker) void
log
(org.slf4j.event.LoggingEvent slf4jEvent) Support SLF4J interception during initialization as introduced in SLF4J version 1.7.15void
log
(org.slf4j.Marker marker, String fqcn, int levelInt, String message, Object[] argArray, Throwable t) org.slf4j.spi.LoggingEventBuilder
makeLoggingEventBuilder
(org.slf4j.event.Level level) Creates aLoggingEventBuilder
of typeLogbackLoggingEventBuilder
.protected Object
After serialization, the logger instance does not know its LoggerContext.void
setAdditive
(boolean additive) void
toString()
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.slf4j.Logger
atDebug, atError, atInfo, atTrace, atWarn, isEnabledForLevel
-
Field Details
-
FQCN
The fully qualified name of this class. Used in gathering caller information.
-
-
Method Details
-
getEffectiveLevel
-
getLevel
-
getName
- Specified by:
getName
in interfaceorg.slf4j.Logger
-
setLevel
-
detachAndStopAllAppenders
public void detachAndStopAllAppenders()Remove all previously added appenders from this logger instance. This is useful when re-reading configuration information.- Specified by:
detachAndStopAllAppenders
in interfaceAppenderAttachable<ILoggingEvent>
-
detachAppender
- Specified by:
detachAppender
in interfaceAppenderAttachable<ILoggingEvent>
-
addAppender
- Specified by:
addAppender
in interfaceAppenderAttachable<ILoggingEvent>
-
isAttached
- Specified by:
isAttached
in interfaceAppenderAttachable<ILoggingEvent>
-
iteratorForAppenders
- Specified by:
iteratorForAppenders
in interfaceAppenderAttachable<ILoggingEvent>
-
getAppender
- Specified by:
getAppender
in interfaceAppenderAttachable<ILoggingEvent>
-
callAppenders
Invoke all the appenders of this logger.- Parameters:
event
- The event to log
-
detachAppender
Remove the appender passed as parameter form the list of appenders.- Specified by:
detachAppender
in interfaceAppenderAttachable<ILoggingEvent>
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
trace
- Specified by:
trace
in interfaceorg.slf4j.Logger
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabled
in interfaceorg.slf4j.Logger
-
isDebugEnabled
public boolean isDebugEnabled(org.slf4j.Marker marker) - Specified by:
isDebugEnabled
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
debug
- Specified by:
debug
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
error
- Specified by:
error
in interfaceorg.slf4j.Logger
-
isInfoEnabled
public boolean isInfoEnabled()- Specified by:
isInfoEnabled
in interfaceorg.slf4j.Logger
-
isInfoEnabled
public boolean isInfoEnabled(org.slf4j.Marker marker) - Specified by:
isInfoEnabled
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
info
- Specified by:
info
in interfaceorg.slf4j.Logger
-
isTraceEnabled
public boolean isTraceEnabled()- Specified by:
isTraceEnabled
in interfaceorg.slf4j.Logger
-
isTraceEnabled
public boolean isTraceEnabled(org.slf4j.Marker marker) - Specified by:
isTraceEnabled
in interfaceorg.slf4j.Logger
-
isErrorEnabled
public boolean isErrorEnabled()- Specified by:
isErrorEnabled
in interfaceorg.slf4j.Logger
-
isErrorEnabled
public boolean isErrorEnabled(org.slf4j.Marker marker) - Specified by:
isErrorEnabled
in interfaceorg.slf4j.Logger
-
isWarnEnabled
public boolean isWarnEnabled()- Specified by:
isWarnEnabled
in interfaceorg.slf4j.Logger
-
isWarnEnabled
public boolean isWarnEnabled(org.slf4j.Marker marker) - Specified by:
isWarnEnabled
in interfaceorg.slf4j.Logger
-
isEnabledFor
-
isEnabledFor
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
warn
- Specified by:
warn
in interfaceorg.slf4j.Logger
-
isAdditive
public boolean isAdditive() -
setAdditive
public void setAdditive(boolean additive) -
toString
-
getLoggerContext
Return the context for this logger.- Returns:
- the context
-
makeLoggingEventBuilder
public org.slf4j.spi.LoggingEventBuilder makeLoggingEventBuilder(org.slf4j.event.Level level) Creates aLoggingEventBuilder
of typeLogbackLoggingEventBuilder
.- Specified by:
makeLoggingEventBuilder
in interfaceorg.slf4j.Logger
- Since:
- 1.3
-
log
public void log(org.slf4j.Marker marker, String fqcn, int levelInt, String message, Object[] argArray, Throwable t) - Specified by:
log
in interfaceorg.slf4j.spi.LocationAwareLogger
-
log
public void log(org.slf4j.event.LoggingEvent slf4jEvent) Support SLF4J interception during initialization as introduced in SLF4J version 1.7.15- Parameters:
slf4jEvent
-- Since:
- 1.1.4
-
readResolve
After serialization, the logger instance does not know its LoggerContext. The best we can do here, is to return a logger with the same name returned by org.slf4j.LoggerFactory.- Returns:
- Logger instance with the same name
- Throws:
ObjectStreamException
-