Top Fields Constructors Methods
ch.qos.logback.classic

public final Class Logger

extends Object
implements Logger, LocationAwareLogger, LoggingEventAware, AppenderAttachable<ILoggingEvent>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, ch.qos.logback.core.spi.AppenderAttachable, org.slf4j.spi.LoggingEventAware, org.slf4j.spi.LocationAwareLogger, org.slf4j.Logger
Imports
java.io.ObjectStreamException, .Serializable, java.util.Collections, .Iterator, .List, java.util.concurrent.CopyOnWriteArrayList, org.slf4j.LoggerFactory, .Marker, org.slf4j.spi.DefaultLoggingEventBuilder, .LocationAwareLogger, .LoggingEventAware, .LoggingEventBuilder, ch.qos.logback.classic.spi.ILoggingEvent, .LoggingEvent, ch.qos.logback.classic.util.LoggerNameUtil, ch.qos.logback.core.Appender, .CoreConstants, ch.qos.logback.core.spi.AppenderAttachable, .AppenderAttachableImpl, .FilterReply

Field Summary

Modifier and TypeField and Description
private transient AppenderAttachableImpl<ILoggingEvent>
aai

It is assumed that once the 'aai' variable is set to a non-null value, it will never be reset to null.

private transient boolean
additive

Additivity is set to true by default, that is children inherit the appenders of their ancestors by default.

private transient List<Logger>
childrenList

The children of this logger.

private transient int
public static final String
FQCN

The fully qualified name of this class.

private transient Level
pack-priv final transient LoggerContext
private String
name

The name of this logger

private transient Logger
parent

The parent of this category.

private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
Logger(String name, Logger parent, LoggerContext loggerContext)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
private int
private void
buildLoggingEventAndAppend(final String localFQCN, final Marker marker, final Level level, final String msg, final Object[] params, final Throwable t)

public void
callAppenders(ILoggingEvent
The event to log
event
)

Invoke all the appenders of this logger.

private FilterReply

Returns:

the reply given by the TurboFilters
callTurboFilters
(Marker marker, Level level)

Method that calls the attached TurboFilter objects based on the logger and the level.

pack-priv Logger
createChildByLastNamePart(final String
the suffix (i.e. last part) of the child logger name. This parameter may not include dots, i.e. the logger separator character.
lastPart
)

Create a child of this logger by suffix, that is, the part of the name extending this logger.

pack-priv Logger
createChildByName(final String childName)

The default size of child list arrays.

public void
debug(String
the message string to be logged
msg
)

Implements org.slf4j.Logger.debug.

Log a message at the DEBUG level.
public void
debug(String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.debug.

Log a message at the DEBUG level according to the specified format and argument.
public void
debug(String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.debug.

Log a message at the DEBUG level according to the specified format and arguments.
public void
debug(String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.debug.

Log a message at the DEBUG level according to the specified format and arguments.
public void
debug(String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.debug.

Log an exception (throwable) at the DEBUG level with an accompanying message.
public void
debug(Marker
the marker data specific to this log statement
marker
,
String
the message string to be logged
msg
)

Implements org.slf4j.Logger.debug.

Log a message with the specific Marker at the DEBUG level.
public void
debug(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.debug.

This method is similar to debug(String, Object) method except that the marker data is also taken into consideration.
public void
debug(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.debug.

This method is similar to debug(String, Object, Object) method except that the marker data is also taken into consideration.
public void
debug(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.debug.

This method is similar to debug(String, Object...) method except that the marker data is also taken into consideration.
public void
debug(Marker
the marker data specific to this log statement
marker
,
String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.debug.

This method is similar to debug(String, Throwable) method except that the marker data is also taken into consideration.
public void
detachAndStopAllAppenders()

Implements ch.qos.logback.core.spi.AppenderAttachable.detachAndStopAllAppenders.

Remove all previously added appenders from this logger instance.
public boolean
detachAppender(String name)

Implements ch.qos.logback.core.spi.AppenderAttachable.detachAppender.

Detach the appender with the name passed as parameter from the list of appenders.
public boolean
detachAppender(Appender<ILoggingEvent> appender)

Implements ch.qos.logback.core.spi.AppenderAttachable.detachAppender.

Remove the appender passed as parameter form the list of appenders.
public void
error(String
the message string to be logged
msg
)

Implements org.slf4j.Logger.error.

Log a message at the ERROR level.
public void
error(String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.error.

Log a message at the ERROR level according to the specified format and argument.
public void
error(String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.error.

Log a message at the ERROR level according to the specified format and arguments.
public void
error(String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.error.

Log a message at the ERROR level according to the specified format and arguments.
public void
error(String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.error.

Log an exception (throwable) at the ERROR level with an accompanying message.
public void
error(Marker
The marker specific to this log statement
marker
,
String
the message string to be logged
msg
)

Implements org.slf4j.Logger.error.

Log a message with the specific Marker at the ERROR level.
public void
error(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.error.

This method is similar to error(String, Object) method except that the marker data is also taken into consideration.
public void
error(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.error.

This method is similar to error(String, Object, Object) method except that the marker data is also taken into consideration.
public void
error(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.error.

This method is similar to error(String, Object...) method except that the marker data is also taken into consideration.
public void
error(Marker
the marker data specific to this log statement
marker
,
String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.error.

This method is similar to error(String, Throwable) method except that the marker data is also taken into consideration.
private void
filterAndLog_0_Or3Plus(final String localFQCN, final Marker marker, final Level level, final String msg, final Object[] params, final Throwable t)

The next methods are not merged into one because of the time we gain by not creating a new Object[] with the params.

private void
filterAndLog_1(final String localFQCN, final Marker marker, final Level level, final String msg, final Object param, final Throwable t)

private void
filterAndLog_2(final String localFQCN, final Marker marker, final Level level, final String msg, final Object param1, final Object param2, final Throwable t)

public Appender<ILoggingEvent>
pack-priv Logger
getChildByName(final String childName)

public Level
pack-priv int
public Level
public LoggerContext

Returns:

the context
getLoggerContext
()

Return the context for this logger.

public String
getName()

Implements org.slf4j.Logger.getName.

Return the name of this Logger instance.
private synchronized void
handleParentLevelChange(int newParentLevelInt)

This method is invoked by parent logger to let this logger know that the prent's levelInt changed.

public void
info(String
the message string to be logged
msg
)

Implements org.slf4j.Logger.info.

Log a message at the INFO level.
public void
info(String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.info.

Log a message at the INFO level according to the specified format and argument.
public void
info(String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.info.

Log a message at the INFO level according to the specified format and arguments.
public void
info(String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.info.

Log a message at the INFO level according to the specified format and arguments.
public void
info(String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.info.

Log an exception (throwable) at the INFO level with an accompanying message.
public void
info(Marker
The marker specific to this log statement
marker
,
String
the message string to be logged
msg
)

Implements org.slf4j.Logger.info.

Log a message with the specific Marker at the INFO level.
public void
info(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.info.

This method is similar to info(String, Object) method except that the marker data is also taken into consideration.
public void
info(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.info.

This method is similar to info(String, Object, Object) method except that the marker data is also taken into consideration.
public void
info(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.info.

This method is similar to info(String, Object...) method except that the marker data is also taken into consideration.
public void
info(Marker
the marker data for this log statement
marker
,
String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.info.

This method is similar to info(String, Throwable) method except that the marker data is also taken into consideration.
public boolean
public boolean
isAttached(Appender<ILoggingEvent> appender)

Implements ch.qos.logback.core.spi.AppenderAttachable.isAttached.

Returns true if the specified appender is in list of attached, false otherwise.
public boolean
isDebugEnabled()

Implements org.slf4j.Logger.isDebugEnabled.

Is the logger instance enabled for the DEBUG level?
public boolean
isDebugEnabled(Marker
The marker data to take into consideration
marker
)

Implements org.slf4j.Logger.isDebugEnabled.

Similar to isDebugEnabled() method except that the marker data is also taken into account.
public boolean
isEnabledFor(Marker marker, Level level)

public boolean
public boolean
isErrorEnabled()

Implements org.slf4j.Logger.isErrorEnabled.

Is the logger instance enabled for the ERROR level?
public boolean
isErrorEnabled(Marker
The marker data to take into consideration
marker
)

Implements org.slf4j.Logger.isErrorEnabled.

Similar to isErrorEnabled() method except that the marker data is also taken into consideration.
public boolean
isInfoEnabled()

Implements org.slf4j.Logger.isInfoEnabled.

Is the logger instance enabled for the INFO level?
public boolean
isInfoEnabled(Marker
The marker data to take into consideration
marker
)

Implements org.slf4j.Logger.isInfoEnabled.

Similar to isInfoEnabled() method except that the marker data is also taken into consideration.
private boolean
public boolean
isTraceEnabled()

Implements org.slf4j.Logger.isTraceEnabled.

Is the logger instance enabled for the TRACE level?
public boolean
isTraceEnabled(Marker
The marker data to take into consideration
marker
)

Implements org.slf4j.Logger.isTraceEnabled.

Similar to isTraceEnabled() method except that the marker data is also taken into account.
public boolean
isWarnEnabled()

Implements org.slf4j.Logger.isWarnEnabled.

Is the logger instance enabled for the WARN level?
public boolean
isWarnEnabled(Marker
The marker data to take into consideration
marker
)

Implements org.slf4j.Logger.isWarnEnabled.

Similar to isWarnEnabled() method except that the marker data is also taken into consideration.
public Iterator<Appender<ILoggingEvent>>
iteratorForAppenders()

Implements ch.qos.logback.core.spi.AppenderAttachable.iteratorForAppenders.

Get an iterator for appenders contained in the parent object.
private void
public void
log(Marker
The marker to be used for this event, may be null.
marker
,
String
The fully qualified class name of the logger instance, typically the logger class, logger bridge or a logger wrapper.
fqcn
,
int
One of the level integers defined in this interface
levelInt
,
String
The message for the log event
message
,
Object[] argArray, Throwable
Throwable associated with the log event, may be null.
t
)

Implements org.slf4j.spi.LocationAwareLogger.log.

Printing method with support for location information.
public void
log(LoggingEvent slf4jEvent)

Implements org.slf4j.spi.LoggingEventAware.log.

Support SLF4J interception during initialization as introduced in SLF4J version 1.7.15
public LoggingEventBuilder
makeLoggingEventBuilder(Level
desired level for the event builder
level
)

Overrides default org.slf4j.Logger.makeLoggingEventBuilder.

Creates a LoggingEventBuilder of type DefaultLoggingEventBuilder.
protected Object

Returns:

Logger instance with the same name
readResolve
()

After serialization, the logger instance does not know its LoggerContext.

pack-priv void
public void
setAdditive(boolean additive)

public synchronized void
setLevel(Level newLevel)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
trace(String
the message string to be logged
msg
)

Implements org.slf4j.Logger.trace.

Log a message at the TRACE level.
public void
trace(String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.trace.

Log a message at the TRACE level according to the specified format and argument.
public void
trace(String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.trace.

Log a message at the TRACE level according to the specified format and arguments.
public void
trace(String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.trace.

Log a message at the TRACE level according to the specified format and arguments.
public void
trace(String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.trace.

Log an exception (throwable) at the TRACE level with an accompanying message.
public void
trace(Marker
the marker data specific to this log statement
marker
,
String
the message string to be logged
msg
)

Implements org.slf4j.Logger.trace.

Log a message with the specific Marker at the TRACE level.
public void
trace(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.trace.

This method is similar to trace(String, Object) method except that the marker data is also taken into consideration.
public void
trace(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.trace.

This method is similar to trace(String, Object, Object) method except that the marker data is also taken into consideration.
public void
trace(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object...
an array of arguments
argArray
)

Implements org.slf4j.Logger.trace.

This method is similar to trace(String, Object...) method except that the marker data is also taken into consideration.
public void
trace(Marker
the marker data specific to this log statement
marker
,
String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.trace.

This method is similar to trace(String, Throwable) method except that the marker data is also taken into consideration.
public void
warn(String
the message string to be logged
msg
)

Implements org.slf4j.Logger.warn.

Log a message at the WARN level.
public void
warn(String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.warn.

Log an exception (throwable) at the WARN level with an accompanying message.
public void
warn(String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.warn.

Log a message at the WARN level according to the specified format and argument.
public void
warn(String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.warn.

Log a message at the WARN level according to the specified format and arguments.
public void
warn(String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.warn.

Log a message at the WARN level according to the specified format and arguments.
public void
warn(Marker
The marker specific to this log statement
marker
,
String
the message string to be logged
msg
)

Implements org.slf4j.Logger.warn.

Log a message with the specific Marker at the WARN level.
public void
warn(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the argument
arg
)

Implements org.slf4j.Logger.warn.

This method is similar to warn(String, Object) method except that the marker data is also taken into consideration.
public void
warn(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object...
a list of 3 or more arguments
argArray
)

Implements org.slf4j.Logger.warn.

This method is similar to warn(String, Object...) method except that the marker data is also taken into consideration.
public void
warn(Marker
the marker data specific to this log statement
marker
,
String
the format string
format
,
Object
the first argument
arg1
,
Object
the second argument
arg2
)

Implements org.slf4j.Logger.warn.

This method is similar to warn(String, Object, Object) method except that the marker data is also taken into consideration.
public void
warn(Marker
the marker data for this log statement
marker
,
String
the message accompanying the exception
msg
,
Throwable
the exception (throwable) to log
t
)

Implements org.slf4j.Logger.warn.

This method is similar to warn(String, Throwable) method except that the marker data is also taken into consideration.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait