ch.qos.logback.classic
Class Logger

java.lang.Object
  extended by 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:
Serialized Form

Field Summary
static String FQCN
          The fully qualified name of this class.
 
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
 void addAppender(Appender<ILoggingEvent> newAppender)
          Add an appender.
 void callAppenders(ILoggingEvent event)
          Invoke all the appenders of this logger.
 void debug(org.slf4j.Marker marker, String msg)
           
 void debug(org.slf4j.Marker marker, String format, Object arg)
           
 void debug(org.slf4j.Marker marker, String format, Object[] argArray)
           
 void debug(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
           
 void debug(org.slf4j.Marker marker, String msg, Throwable t)
           
 void debug(String msg)
           
 void debug(String format, Object arg)
           
 void debug(String format, Object[] argArray)
           
 void debug(String format, Object arg1, Object arg2)
           
 void debug(String msg, Throwable t)
           
 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(String name)
          Detach the appender with the name passed as parameter from the list of appenders.
 void error(org.slf4j.Marker marker, String msg)
           
 void error(org.slf4j.Marker marker, String format, Object arg)
           
 void error(org.slf4j.Marker marker, String format, Object[] argArray)
           
 void error(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
           
 void error(org.slf4j.Marker marker, String msg, Throwable t)
           
 void error(String msg)
           
 void error(String format, Object arg)
           
 void error(String format, Object[] argArray)
           
 void error(String format, Object arg1, Object arg2)
           
 void error(String msg, Throwable t)
           
 Appender<ILoggingEvent> getAppender(String name)
          Get an appender by name.
 Level getEffectiveLevel()
           
 Level getLevel()
           
 LoggerContext getLoggerContext()
          Return the context for this logger.
 LoggerRemoteView getLoggerRemoteView()
           
 String getName()
           
 void info(org.slf4j.Marker marker, String msg)
           
 void info(org.slf4j.Marker marker, String format, Object arg)
           
 void info(org.slf4j.Marker marker, String format, Object[] argArray)
           
 void info(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
           
 void info(org.slf4j.Marker marker, String msg, Throwable t)
           
 void info(String msg)
           
 void info(String format, Object arg)
           
 void info(String format, Object[] argArray)
           
 void info(String format, Object arg1, Object arg2)
           
 void info(String msg, Throwable t)
           
 boolean isAdditive()
           
 boolean isAttached(Appender<ILoggingEvent> appender)
          Returns true if the specified appender is in list of attached attached, false otherwise.
 boolean isDebugEnabled()
           
 boolean isDebugEnabled(org.slf4j.Marker marker)
           
 boolean isEnabledFor(Level level)
           
 boolean isEnabledFor(org.slf4j.Marker marker, Level level)
           
 boolean isErrorEnabled()
           
 boolean isErrorEnabled(org.slf4j.Marker marker)
           
 boolean isInfoEnabled()
           
 boolean isInfoEnabled(org.slf4j.Marker marker)
           
 boolean isTraceEnabled()
           
 boolean isTraceEnabled(org.slf4j.Marker marker)
           
 boolean isWarnEnabled()
           
 boolean isWarnEnabled(org.slf4j.Marker marker)
           
 Iterator<Appender<ILoggingEvent>> iteratorForAppenders()
          Get an iterator for appenders contained in the parent object.
 void log(org.slf4j.Marker marker, String fqcn, int levelInt, String message, Object[] argArray, Throwable t)
           
protected  Object readResolve()
          After serialization, the logger instance does not know its LoggerContext.
 void setAdditive(boolean additive)
           
 void setLevel(Level newLevel)
           
 String toString()
           
 void trace(org.slf4j.Marker marker, String msg)
           
 void trace(org.slf4j.Marker marker, String format, Object arg)
           
 void trace(org.slf4j.Marker marker, String format, Object[] argArray)
           
 void trace(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
           
 void trace(org.slf4j.Marker marker, String msg, Throwable t)
           
 void trace(String msg)
           
 void trace(String format, Object arg)
           
 void trace(String format, Object[] argArray)
           
 void trace(String format, Object arg1, Object arg2)
           
 void trace(String msg, Throwable t)
           
 void warn(org.slf4j.Marker marker, String msg)
           
 void warn(org.slf4j.Marker marker, String format, Object arg)
           
 void warn(org.slf4j.Marker marker, String format, Object[] argArray)
           
 void warn(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
           
 void warn(org.slf4j.Marker marker, String msg, Throwable t)
           
 void warn(String msg)
           
 void warn(String format, Object arg)
           
 void warn(String format, Object[] argArray)
           
 void warn(String format, Object arg1, Object arg2)
           
 void warn(String msg, Throwable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FQCN

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

Method Detail

getEffectiveLevel

public Level getEffectiveLevel()

getLevel

public Level getLevel()

getName

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

setLevel

public void setLevel(Level newLevel)

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 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 attached, false otherwise.

Specified by:
isAttached in interface AppenderAttachable<ILoggingEvent>

iteratorForAppenders

public Iterator<Appender<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

public Appender<ILoggingEvent> getAppender(String name)
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

public LoggerContext getLoggerContext()
Return the context for this logger.

Returns:
the context

getLoggerRemoteView

public LoggerRemoteView getLoggerRemoteView()

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

readResolve

protected Object readResolve()
                      throws ObjectStreamException
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 as generated by LoggerFactory.

Returns:
Logger instance with the same name
Throws:
ObjectStreamException


Copyright © 2005-2013 QOS.ch. All Rights Reserved.