Class Logger

java.lang.Object
ch.qos.logback.classic.Logger
All Implemented Interfaces:
AppenderAttachable<ILoggingEvent>, Serializable, org.slf4j.Logger, org.slf4j.spi.LocationAwareLogger, org.slf4j.spi.LoggingEventAware

public final class Logger extends Object implements org.slf4j.Logger, org.slf4j.spi.LocationAwareLogger, org.slf4j.spi.LoggingEventAware, AppenderAttachable<ILoggingEvent>, Serializable
See Also:
  • Field Details

    • FQCN

      public static final String FQCN
      The fully qualified name of this class. Used in gathering caller information.
  • Method Details

    • getEffectiveLevel

    • getLevel

      public Level getLevel()
    • getName

      public String getName()
      Specified by:
      getName in interface org.slf4j.Logger
    • setLevel

      public void setLevel(Level newLevel)
    • detachAndStopAllAppenders

      Remove all previously added appenders from this logger instance.

      This is useful when re-reading configuration information.

      Specified by:
      detachAndStopAllAppenders in interface AppenderAttachable<ILoggingEvent>
    • detachAppender

      public boolean detachAppender(String name)
      Description copied from interface: AppenderAttachable
      Detach the appender with the name passed as parameter from the list of appenders.
      Specified by:
      detachAppender in interface AppenderAttachable<ILoggingEvent>
    • addAppender

      public void addAppender(Appender<ILoggingEvent> newAppender)
      Description copied from interface: AppenderAttachable
      Add an appender.
      Specified by:
      addAppender in interface AppenderAttachable<ILoggingEvent>
    • isAttached

      public boolean isAttached(Appender<ILoggingEvent> appender)
      Description copied from interface: AppenderAttachable
      Returns true if the specified appender is in list of attached, false otherwise.
      Specified by:
      isAttached in interface AppenderAttachable<ILoggingEvent>
    • iteratorForAppenders

      Description copied from interface: AppenderAttachable
      Get an iterator for appenders contained in the parent object.
      Specified by:
      iteratorForAppenders in interface AppenderAttachable<ILoggingEvent>
    • getAppender

      Description copied from interface: AppenderAttachable
      Get an appender by name.
      Specified by:
      getAppender in interface AppenderAttachable<ILoggingEvent>
    • callAppenders

      public void callAppenders(ILoggingEvent event)
      Invoke all the appenders of this logger.
      Parameters:
      event - The event to log
    • detachAppender

      public boolean detachAppender(Appender<ILoggingEvent> appender)
      Remove the appender passed as parameter form the list of appenders.
      Specified by:
      detachAppender in interface AppenderAttachable<ILoggingEvent>
    • trace

      public void trace(String msg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object arg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object arg1, Object arg2)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object... argArray)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String msg, Throwable t)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String msg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      trace in interface org.slf4j.Logger
    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface org.slf4j.Logger
    • isDebugEnabled

      public boolean isDebugEnabled(org.slf4j.Marker marker)
      Specified by:
      isDebugEnabled in interface org.slf4j.Logger
    • debug

      public void debug(String msg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object arg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object arg1, Object arg2)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object... argArray)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String msg, Throwable t)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String msg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      debug in interface org.slf4j.Logger
    • error

      public void error(String msg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object arg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object arg1, Object arg2)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object... argArray)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String msg, Throwable t)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String msg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      error in interface org.slf4j.Logger
    • isInfoEnabled

      public boolean isInfoEnabled()
      Specified by:
      isInfoEnabled in interface org.slf4j.Logger
    • isInfoEnabled

      public boolean isInfoEnabled(org.slf4j.Marker marker)
      Specified by:
      isInfoEnabled in interface org.slf4j.Logger
    • info

      public void info(String msg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object arg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object arg1, Object arg2)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object... argArray)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String msg, Throwable t)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String msg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      info in interface org.slf4j.Logger
    • isTraceEnabled

      public boolean isTraceEnabled()
      Specified by:
      isTraceEnabled in interface org.slf4j.Logger
    • isTraceEnabled

      public boolean isTraceEnabled(org.slf4j.Marker marker)
      Specified by:
      isTraceEnabled in interface org.slf4j.Logger
    • isErrorEnabled

      public boolean isErrorEnabled()
      Specified by:
      isErrorEnabled in interface org.slf4j.Logger
    • isErrorEnabled

      public boolean isErrorEnabled(org.slf4j.Marker marker)
      Specified by:
      isErrorEnabled in interface org.slf4j.Logger
    • isWarnEnabled

      public boolean isWarnEnabled()
      Specified by:
      isWarnEnabled in interface org.slf4j.Logger
    • isWarnEnabled

      public boolean isWarnEnabled(org.slf4j.Marker marker)
      Specified by:
      isWarnEnabled in interface org.slf4j.Logger
    • isEnabledFor

      public boolean isEnabledFor(org.slf4j.Marker marker, Level level)
    • isEnabledFor

      public boolean isEnabledFor(Level level)
    • warn

      public void warn(String msg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String msg, Throwable t)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object arg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object arg1, Object arg2)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object... argArray)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String msg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      warn in interface org.slf4j.Logger
    • isAdditive

      public boolean isAdditive()
    • setAdditive

      public void setAdditive(boolean additive)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLoggerContext

      Return the context for this logger.
      Returns:
      the context
    • makeLoggingEventBuilder

      public org.slf4j.spi.LoggingEventBuilder makeLoggingEventBuilder(org.slf4j.event.Level level)
      Creates a LoggingEventBuilder of type DefaultLoggingEventBuilder.
      Specified by:
      makeLoggingEventBuilder in interface org.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 interface org.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
      Specified by:
      log in interface org.slf4j.spi.LoggingEventAware
      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