public final class Logger extends java.lang.Object implements Logger, LocationAwareLogger, AppenderAttachable<ILoggingEvent>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FQCN
The fully qualified name of this class.
|
DEBUG_INT, ERROR_INT, INFO_INT, TRACE_INT, WARN_INT
ROOT_LOGGER_NAME
Modifier and Type | Method and Description |
---|---|
void |
addAppender(Appender<ILoggingEvent> newAppender)
Add an appender.
|
void |
callAppenders(ILoggingEvent event)
Invoke all the appenders of this logger.
|
void |
debug(Marker marker,
java.lang.String msg)
Log a message with the specific Marker at the DEBUG level.
|
void |
debug(Marker marker,
java.lang.String format,
java.lang.Object... argArray)
This method is similar to
Logger.debug(String, Object...)
method except that the marker data is also taken into
consideration. |
void |
debug(Marker marker,
java.lang.String format,
java.lang.Object arg)
This method is similar to
Logger.debug(String, Object) method except that the
marker data is also taken into consideration. |
void |
debug(Marker marker,
java.lang.String format,
java.lang.Object arg1,
java.lang.Object arg2)
This method is similar to
Logger.debug(String, Object, Object)
method except that the marker data is also taken into
consideration. |
void |
debug(Marker marker,
java.lang.String msg,
java.lang.Throwable t)
This method is similar to
Logger.debug(String, Throwable) method except that the
marker data is also taken into consideration. |
void |
debug(java.lang.String msg)
Log a message at the DEBUG level.
|
void |
debug(java.lang.String format,
java.lang.Object... argArray)
Log a message at the DEBUG level according to the specified format
and arguments.
|
void |
debug(java.lang.String format,
java.lang.Object arg)
Log a message at the DEBUG level according to the specified format
and argument.
|
void |
debug(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.
|
void |
debug(java.lang.String msg,
java.lang.Throwable t)
Log an exception (throwable) at the DEBUG level with an
accompanying message.
|
void |
detachAndStopAllAppenders()
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(java.lang.String name)
Detach the appender with the name passed as parameter from the list of
appenders.
|
void |
error(Marker marker,
java.lang.String msg)
Log a message with the specific Marker at the ERROR level.
|
void |
error(Marker marker,
java.lang.String format,
java.lang.Object... argArray)
This method is similar to
Logger.error(String, Object...)
method except that the marker data is also taken into
consideration. |
void |
error(Marker marker,
java.lang.String format,
java.lang.Object arg)
This method is similar to
Logger.error(String, Object) method except that the
marker data is also taken into consideration. |
void |
error(Marker marker,
java.lang.String format,
java.lang.Object arg1,
java.lang.Object arg2)
This method is similar to
Logger.error(String, Object, Object)
method except that the marker data is also taken into
consideration. |
void |
error(Marker marker,
java.lang.String msg,
java.lang.Throwable t)
This method is similar to
Logger.error(String, Throwable)
method except that the marker data is also taken into
consideration. |
void |
error(java.lang.String msg)
Log a message at the ERROR level.
|
void |
error(java.lang.String format,
java.lang.Object... argArray)
Log a message at the ERROR level according to the specified format
and arguments.
|
void |
error(java.lang.String format,
java.lang.Object arg)
Log a message at the ERROR level according to the specified format
and argument.
|
void |
error(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.
|
void |
error(java.lang.String msg,
java.lang.Throwable t)
Log an exception (throwable) at the ERROR level with an
accompanying message.
|
Appender<ILoggingEvent> |
getAppender(java.lang.String name)
Get an appender by name.
|
Level |
getEffectiveLevel() |
Level |
getLevel() |
LoggerContext |
getLoggerContext()
Return the context for this logger.
|
java.lang.String |
getName()
Return the name of this
Logger instance. |
void |
info(Marker marker,
java.lang.String msg)
Log a message with the specific Marker at the INFO level.
|
void |
info(Marker marker,
java.lang.String format,
java.lang.Object... argArray)
This method is similar to
Logger.info(String, Object...)
method except that the marker data is also taken into
consideration. |
void |
info(Marker marker,
java.lang.String format,
java.lang.Object arg)
This method is similar to
Logger.info(String, Object) method except that the
marker data is also taken into consideration. |
void |
info(Marker marker,
java.lang.String format,
java.lang.Object arg1,
java.lang.Object arg2)
This method is similar to
Logger.info(String, Object, Object)
method except that the marker data is also taken into
consideration. |
void |
info(Marker marker,
java.lang.String msg,
java.lang.Throwable t)
This method is similar to
Logger.info(String, Throwable) method
except that the marker data is also taken into consideration. |
void |
info(java.lang.String msg)
Log a message at the INFO level.
|
void |
info(java.lang.String format,
java.lang.Object... argArray)
Log a message at the INFO level according to the specified format
and arguments.
|
void |
info(java.lang.String format,
java.lang.Object arg)
Log a message at the INFO level according to the specified format
and argument.
|
void |
info(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.
|
void |
info(java.lang.String msg,
java.lang.Throwable t)
Log an exception (throwable) at the INFO level with an
accompanying message.
|
boolean |
isAdditive() |
boolean |
isAttached(Appender<ILoggingEvent> appender)
Returns
true if the specified appender is in list of
attached attached, false otherwise. |
boolean |
isDebugEnabled()
Is the logger instance enabled for the DEBUG level?
|
boolean |
isDebugEnabled(Marker marker)
Similar to
Logger.isDebugEnabled() method except that the
marker data is also taken into account. |
boolean |
isEnabledFor(Level level) |
boolean |
isEnabledFor(Marker marker,
Level level) |
boolean |
isErrorEnabled()
Is the logger instance enabled for the ERROR level?
|
boolean |
isErrorEnabled(Marker marker)
Similar to
Logger.isErrorEnabled() method except that the
marker data is also taken into consideration. |
boolean |
isInfoEnabled()
Is the logger instance enabled for the INFO level?
|
boolean |
isInfoEnabled(Marker marker)
Similar to
Logger.isInfoEnabled() method except that the marker
data is also taken into consideration. |
boolean |
isTraceEnabled()
Is the logger instance enabled for the TRACE level?
|
boolean |
isTraceEnabled(Marker marker)
Similar to
Logger.isTraceEnabled() method except that the
marker data is also taken into account. |
boolean |
isWarnEnabled()
Is the logger instance enabled for the WARN level?
|
boolean |
isWarnEnabled(Marker marker)
Similar to
Logger.isWarnEnabled() method except that the marker
data is also taken into consideration. |
java.util.Iterator<Appender<ILoggingEvent>> |
iteratorForAppenders()
Get an iterator for appenders contained in the parent object.
|
void |
log(LoggingEvent slf4jEvent)
Support SLF4J interception during initialization as introduced in SLF4J version 1.7.15
|
void |
log(Marker marker,
java.lang.String fqcn,
int levelInt,
java.lang.String message,
java.lang.Object[] argArray,
java.lang.Throwable t)
Printing method with support for location information.
|
void |
setAdditive(boolean additive) |
void |
setLevel(Level newLevel) |
java.lang.String |
toString() |
void |
trace(Marker marker,
java.lang.String msg)
Log a message with the specific Marker at the TRACE level.
|
void |
trace(Marker marker,
java.lang.String format,
java.lang.Object... argArray)
This method is similar to
Logger.trace(String, Object...)
method except that the marker data is also taken into
consideration. |
void |
trace(Marker marker,
java.lang.String format,
java.lang.Object arg)
This method is similar to
Logger.trace(String, Object) method except that the
marker data is also taken into consideration. |
void |
trace(Marker marker,
java.lang.String format,
java.lang.Object arg1,
java.lang.Object arg2)
This method is similar to
Logger.trace(String, Object, Object)
method except that the marker data is also taken into
consideration. |
void |
trace(Marker marker,
java.lang.String msg,
java.lang.Throwable t)
This method is similar to
Logger.trace(String, Throwable) method except that the
marker data is also taken into consideration. |
void |
trace(java.lang.String msg)
Log a message at the TRACE level.
|
void |
trace(java.lang.String format,
java.lang.Object... argArray)
Log a message at the TRACE level according to the specified format
and arguments.
|
void |
trace(java.lang.String format,
java.lang.Object arg)
Log a message at the TRACE level according to the specified format
and argument.
|
void |
trace(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.
|
void |
trace(java.lang.String msg,
java.lang.Throwable t)
Log an exception (throwable) at the TRACE level with an
accompanying message.
|
void |
warn(Marker marker,
java.lang.String msg)
Log a message with the specific Marker at the WARN level.
|
void |
warn(Marker marker,
java.lang.String format,
java.lang.Object... argArray)
This method is similar to
Logger.warn(String, Object...)
method except that the marker data is also taken into
consideration. |
void |
warn(Marker marker,
java.lang.String format,
java.lang.Object arg)
This method is similar to
Logger.warn(String, Object) method except that the
marker data is also taken into consideration. |
void |
warn(Marker marker,
java.lang.String format,
java.lang.Object arg1,
java.lang.Object arg2)
This method is similar to
Logger.warn(String, Object, Object)
method except that the marker data is also taken into
consideration. |
void |
warn(Marker marker,
java.lang.String msg,
java.lang.Throwable t)
This method is similar to
Logger.warn(String, Throwable) method
except that the marker data is also taken into consideration. |
void |
warn(java.lang.String msg)
Log a message at the WARN level.
|
void |
warn(java.lang.String format,
java.lang.Object... argArray)
Log a message at the WARN level according to the specified format
and arguments.
|
void |
warn(java.lang.String format,
java.lang.Object arg)
Log a message at the WARN level according to the specified format
and argument.
|
void |
warn(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.
|
void |
warn(java.lang.String msg,
java.lang.Throwable t)
Log an exception (throwable) at the WARN level with an
accompanying message.
|
public static final java.lang.String FQCN
public Level getEffectiveLevel()
public Level getLevel()
public java.lang.String getName()
Logger
Logger
instance.public void setLevel(Level newLevel)
public void detachAndStopAllAppenders()
detachAndStopAllAppenders
in interface AppenderAttachable<ILoggingEvent>
public boolean detachAppender(java.lang.String name)
AppenderAttachable
detachAppender
in interface AppenderAttachable<ILoggingEvent>
public void addAppender(Appender<ILoggingEvent> newAppender)
AppenderAttachable
addAppender
in interface AppenderAttachable<ILoggingEvent>
public boolean isAttached(Appender<ILoggingEvent> appender)
AppenderAttachable
true
if the specified appender is in list of
attached attached, false
otherwise.isAttached
in interface AppenderAttachable<ILoggingEvent>
public java.util.Iterator<Appender<ILoggingEvent>> iteratorForAppenders()
AppenderAttachable
iteratorForAppenders
in interface AppenderAttachable<ILoggingEvent>
public Appender<ILoggingEvent> getAppender(java.lang.String name)
AppenderAttachable
getAppender
in interface AppenderAttachable<ILoggingEvent>
public void callAppenders(ILoggingEvent event)
event
- The event to logpublic boolean detachAppender(Appender<ILoggingEvent> appender)
detachAppender
in interface AppenderAttachable<ILoggingEvent>
public void trace(java.lang.String msg)
Logger
public void trace(java.lang.String format, java.lang.Object arg)
Logger
This form avoids superfluous object creation when the logger is disabled for the TRACE level.
public void trace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
This form avoids superfluous object creation when the logger is disabled for the TRACE level.
public void trace(java.lang.String format, java.lang.Object... argArray)
Logger
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 taking one
and
two
arguments exist solely in order to avoid this hidden cost.
public void trace(java.lang.String msg, java.lang.Throwable t)
Logger
public void trace(Marker marker, java.lang.String msg)
Logger
public void trace(Marker marker, java.lang.String format, java.lang.Object arg)
Logger
Logger.trace(String, Object)
method except that the
marker data is also taken into consideration.public void trace(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
Logger.trace(String, Object, Object)
method except that the marker data is also taken into
consideration.public void trace(Marker marker, java.lang.String format, java.lang.Object... argArray)
Logger
Logger.trace(String, Object...)
method except that the marker data is also taken into
consideration.public void trace(Marker marker, java.lang.String msg, java.lang.Throwable t)
Logger
Logger.trace(String, Throwable)
method except that the
marker data is also taken into consideration.public boolean isDebugEnabled()
Logger
isDebugEnabled
in interface Logger
public boolean isDebugEnabled(Marker marker)
Logger
Logger.isDebugEnabled()
method except that the
marker data is also taken into account.isDebugEnabled
in interface Logger
marker
- The marker data to take into considerationpublic void debug(java.lang.String msg)
Logger
public void debug(java.lang.String format, java.lang.Object arg)
Logger
This form avoids superfluous object creation when the logger is disabled for the DEBUG level.
public void debug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
This form avoids superfluous object creation when the logger is disabled for the DEBUG level.
public void debug(java.lang.String format, java.lang.Object... argArray)
Logger
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 taking
one
and two
arguments exist solely in order to avoid this hidden cost.
public void debug(java.lang.String msg, java.lang.Throwable t)
Logger
public void debug(Marker marker, java.lang.String msg)
Logger
public void debug(Marker marker, java.lang.String format, java.lang.Object arg)
Logger
Logger.debug(String, Object)
method except that the
marker data is also taken into consideration.public void debug(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
Logger.debug(String, Object, Object)
method except that the marker data is also taken into
consideration.public void debug(Marker marker, java.lang.String format, java.lang.Object... argArray)
Logger
Logger.debug(String, Object...)
method except that the marker data is also taken into
consideration.public void debug(Marker marker, java.lang.String msg, java.lang.Throwable t)
Logger
Logger.debug(String, Throwable)
method except that the
marker data is also taken into consideration.public void error(java.lang.String msg)
Logger
public void error(java.lang.String format, java.lang.Object arg)
Logger
This form avoids superfluous object creation when the logger is disabled for the ERROR level.
public void error(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
This form avoids superfluous object creation when the logger is disabled for the ERROR level.
public void error(java.lang.String format, java.lang.Object... argArray)
Logger
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 taking
one
and two
arguments exist solely in order to avoid this hidden cost.
public void error(java.lang.String msg, java.lang.Throwable t)
Logger
public void error(Marker marker, java.lang.String msg)
Logger
public void error(Marker marker, java.lang.String format, java.lang.Object arg)
Logger
Logger.error(String, Object)
method except that the
marker data is also taken into consideration.public void error(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
Logger.error(String, Object, Object)
method except that the marker data is also taken into
consideration.public void error(Marker marker, java.lang.String format, java.lang.Object... argArray)
Logger
Logger.error(String, Object...)
method except that the marker data is also taken into
consideration.public void error(Marker marker, java.lang.String msg, java.lang.Throwable t)
Logger
Logger.error(String, Throwable)
method except that the marker data is also taken into
consideration.public boolean isInfoEnabled()
Logger
isInfoEnabled
in interface Logger
public boolean isInfoEnabled(Marker marker)
Logger
Logger.isInfoEnabled()
method except that the marker
data is also taken into consideration.isInfoEnabled
in interface Logger
marker
- The marker data to take into considerationpublic void info(java.lang.String msg)
Logger
public void info(java.lang.String format, java.lang.Object arg)
Logger
This form avoids superfluous object creation when the logger is disabled for the INFO level.
public void info(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
This form avoids superfluous object creation when the logger is disabled for the INFO level.
public void info(java.lang.String format, java.lang.Object... argArray)
Logger
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 taking
one
and two
arguments exist solely in order to avoid this hidden cost.
public void info(java.lang.String msg, java.lang.Throwable t)
Logger
public void info(Marker marker, java.lang.String msg)
Logger
public void info(Marker marker, java.lang.String format, java.lang.Object arg)
Logger
Logger.info(String, Object)
method except that the
marker data is also taken into consideration.public void info(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
Logger.info(String, Object, Object)
method except that the marker data is also taken into
consideration.public void info(Marker marker, java.lang.String format, java.lang.Object... argArray)
Logger
Logger.info(String, Object...)
method except that the marker data is also taken into
consideration.public void info(Marker marker, java.lang.String msg, java.lang.Throwable t)
Logger
Logger.info(String, Throwable)
method
except that the marker data is also taken into consideration.public boolean isTraceEnabled()
Logger
isTraceEnabled
in interface Logger
public boolean isTraceEnabled(Marker marker)
Logger
Logger.isTraceEnabled()
method except that the
marker data is also taken into account.isTraceEnabled
in interface Logger
marker
- The marker data to take into considerationpublic boolean isErrorEnabled()
Logger
isErrorEnabled
in interface Logger
public boolean isErrorEnabled(Marker marker)
Logger
Logger.isErrorEnabled()
method except that the
marker data is also taken into consideration.isErrorEnabled
in interface Logger
marker
- The marker data to take into considerationpublic boolean isWarnEnabled()
Logger
isWarnEnabled
in interface Logger
public boolean isWarnEnabled(Marker marker)
Logger
Logger.isWarnEnabled()
method except that the marker
data is also taken into consideration.isWarnEnabled
in interface Logger
marker
- The marker data to take into considerationpublic boolean isEnabledFor(Level level)
public void warn(java.lang.String msg)
Logger
public void warn(java.lang.String msg, java.lang.Throwable t)
Logger
public void warn(java.lang.String format, java.lang.Object arg)
Logger
This form avoids superfluous object creation when the logger is disabled for the WARN level.
public void warn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
This form avoids superfluous object creation when the logger is disabled for the WARN level.
public void warn(java.lang.String format, java.lang.Object... argArray)
Logger
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 taking
one
and two
arguments exist solely in order to avoid this hidden cost.
public void warn(Marker marker, java.lang.String msg)
Logger
public void warn(Marker marker, java.lang.String format, java.lang.Object arg)
Logger
Logger.warn(String, Object)
method except that the
marker data is also taken into consideration.public void warn(Marker marker, java.lang.String format, java.lang.Object... argArray)
Logger
Logger.warn(String, Object...)
method except that the marker data is also taken into
consideration.public void warn(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logger
Logger.warn(String, Object, Object)
method except that the marker data is also taken into
consideration.public void warn(Marker marker, java.lang.String msg, java.lang.Throwable t)
Logger
Logger.warn(String, Throwable)
method
except that the marker data is also taken into consideration.public boolean isAdditive()
public void setAdditive(boolean additive)
public java.lang.String toString()
toString
in class java.lang.Object
public LoggerContext getLoggerContext()
public void log(Marker marker, java.lang.String fqcn, int levelInt, java.lang.String message, java.lang.Object[] argArray, java.lang.Throwable t)
LocationAwareLogger
log
in interface LocationAwareLogger
marker
- The marker to be used for this event, may be null.fqcn
- The fully qualified class name of the logger instance,
typically the logger class, logger bridge or a logger wrapper.levelInt
- One of the level integers defined in this interfacemessage
- The message for the log eventt
- Throwable associated with the log event, may be null.public void log(LoggingEvent slf4jEvent)
slf4jEvent
- Copyright © 2010 - 2020 Adobe. All Rights Reserved