Home » SLF4J-1.5.8 » org » slf4j » [javadoc | source]
org.slf4j
public interface: Logger [javadoc | source]

All Known Implementing Classes:
    Log4jLoggerAdapter, MarkerIgnoringBase, XLogger, JDK14LoggerAdapter, LoggerWrapper, NamedLoggerBase, SimpleLogger, NOPLogger, LocationAwareLogger, JCLLoggerAdapter

The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that logging takes place through concrete implementations of this interface.

Typical usage pattern:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Wombat {

  final static Logger logger = LoggerFactory.getLogger(Wombat.class);
  Integer t;
  Integer oldT;

  public void setTemperature(Integer temperature) {
    oldT = t;        
    t = temperature;
    logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);
    if(temperature.intValue() > 50) {
      logger.info("Temperature has risen above 50 degrees.");
    }
  }
}
Field Summary
public final  String ROOT_LOGGER_NAME    Case insensitive String constant used to retrieve the name of the root logger.
    since: 1.3 -
 
Method from org.slf4j.Logger Summary:
debug,   debug,   debug,   debug,   debug,   debug,   debug,   debug,   debug,   debug,   error,   error,   error,   error,   error,   error,   error,   error,   error,   error,   getName,   info,   info,   info,   info,   info,   info,   info,   info,   info,   info,   isDebugEnabled,   isDebugEnabled,   isErrorEnabled,   isErrorEnabled,   isInfoEnabled,   isInfoEnabled,   isTraceEnabled,   isTraceEnabled,   isWarnEnabled,   isWarnEnabled,   trace,   trace,   trace,   trace,   trace,   trace,   trace,   trace,   trace,   trace,   warn,   warn,   warn,   warn,   warn,   warn,   warn,   warn,   warn,   warn
Method from org.slf4j.Logger Detail:
 public  void debug(String msg)
    Log a message at the DEBUG level.
 public  void debug(String format,
    Object arg)
    Log a message at the DEBUG level according to the specified format and argument.

    This form avoids superfluous object creation when the logger is disabled for the DEBUG level.

 public  void debug(String format,
    Object[] argArray)
    Log a message at the DEBUG level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the DEBUG level.

 public  void debug(String msg,
    Throwable t)
    Log an exception (throwable) at the DEBUG level with an accompanying message.
 public  void debug(Marker marker,
    String msg)
    Log a message with the specific Marker at the DEBUG level.
 public  void debug(String format,
    Object arg1,
    Object arg2)
    Log a message at the DEBUG level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the DEBUG level.

 public  void debug(Marker marker,
    String format,
    Object arg)
    This method is similar to #debug(String, Object) method except that the marker data is also taken into consideration.
 public  void debug(Marker marker,
    String format,
    Object[] argArray)
 public  void debug(Marker marker,
    String msg,
    Throwable t)
 public  void debug(Marker marker,
    String format,
    Object arg1,
    Object arg2)
 public  void error(String msg)
    Log a message at the ERROR level.
 public  void error(String format,
    Object arg)
    Log a message at the ERROR level according to the specified format and argument.

    This form avoids superfluous object creation when the logger is disabled for the ERROR level.

 public  void error(String format,
    Object[] argArray)
    Log a message at the ERROR level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the ERROR level.

 public  void error(String msg,
    Throwable t)
    Log an exception (throwable) at the ERROR level with an accompanying message.
 public  void error(Marker marker,
    String msg)
    Log a message with the specific Marker at the ERROR level.
 public  void error(String format,
    Object arg1,
    Object arg2)
    Log a message at the ERROR level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the ERROR level.

 public  void error(Marker marker,
    String format,
    Object arg)
    This method is similar to #error(String, Object) method except that the marker data is also taken into consideration.
 public  void error(Marker marker,
    String format,
    Object[] argArray)
 public  void error(Marker marker,
    String msg,
    Throwable t)
 public  void error(Marker marker,
    String format,
    Object arg1,
    Object arg2)
 public String getName()
    Return the name of this Logger instance.
 public  void info(String msg)
    Log a message at the INFO level.
 public  void info(String format,
    Object arg)
    Log a message at the INFO level according to the specified format and argument.

    This form avoids superfluous object creation when the logger is disabled for the INFO level.

 public  void info(String format,
    Object[] argArray)
    Log a message at the INFO level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the INFO level.

 public  void info(String msg,
    Throwable t)
    Log an exception (throwable) at the INFO level with an accompanying message.
 public  void info(Marker marker,
    String msg)
    Log a message with the specific Marker at the INFO level.
 public  void info(String format,
    Object arg1,
    Object arg2)
    Log a message at the INFO level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the INFO level.

 public  void info(Marker marker,
    String format,
    Object arg)
    This method is similar to #info(String, Object) method except that the marker data is also taken into consideration.
 public  void info(Marker marker,
    String format,
    Object[] argArray)
    This method is similar to #info(String, Object[]) method except that the marker data is also taken into consideration.
 public  void info(Marker marker,
    String msg,
    Throwable t)
 public  void info(Marker marker,
    String format,
    Object arg1,
    Object arg2)
 public boolean isDebugEnabled()
    Is the logger instance enabled for the DEBUG level?
 public boolean isDebugEnabled(Marker marker)
    Similar to #isDebugEnabled() method except that the marker data is also taken into account.
 public boolean isErrorEnabled()
    Is the logger instance enabled for the ERROR level?
 public boolean isErrorEnabled(Marker marker)
    Similar to #isErrorEnabled() method except that the marker data is also taken into consideration.
 public boolean isInfoEnabled()
    Is the logger instance enabled for the INFO level?
 public boolean isInfoEnabled(Marker marker)
    Similar to #isInfoEnabled() method except that the marker data is also taken into consideration.
 public boolean isTraceEnabled()
    Is the logger instance enabled for the TRACE level?
 public boolean isTraceEnabled(Marker marker)
    Similar to #isTraceEnabled() method except that the marker data is also taken into account.
 public boolean isWarnEnabled()
    Is the logger instance enabled for the WARN level?
 public boolean isWarnEnabled(Marker marker)
    Similar to #isWarnEnabled() method except that the marker data is also taken into consideration.
 public  void trace(String msg)
    Log a message at the TRACE level.
 public  void trace(String format,
    Object arg)
    Log a message at the TRACE level according to the specified format and argument.

    This form avoids superfluous object creation when the logger is disabled for the TRACE level.

 public  void trace(String format,
    Object[] argArray)
    Log a message at the TRACE level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the TRACE level.

 public  void trace(String msg,
    Throwable t)
    Log an exception (throwable) at the TRACE level with an accompanying message.
 public  void trace(Marker marker,
    String msg)
    Log a message with the specific Marker at the TRACE level.
 public  void trace(String format,
    Object arg1,
    Object arg2)
    Log a message at the TRACE level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the TRACE level.

 public  void trace(Marker marker,
    String format,
    Object arg)
    This method is similar to #trace(String, Object) method except that the marker data is also taken into consideration.
 public  void trace(Marker marker,
    String format,
    Object[] argArray)
 public  void trace(Marker marker,
    String msg,
    Throwable t)
 public  void trace(Marker marker,
    String format,
    Object arg1,
    Object arg2)
 public  void warn(String msg)
    Log a message at the WARN level.
 public  void warn(String format,
    Object arg)
    Log a message at the WARN level according to the specified format and argument.

    This form avoids superfluous object creation when the logger is disabled for the WARN level.

 public  void warn(String format,
    Object[] argArray)
    Log a message at the WARN level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the WARN level.

 public  void warn(String msg,
    Throwable t)
    Log an exception (throwable) at the WARN level with an accompanying message.
 public  void warn(Marker marker,
    String msg)
    Log a message with the specific Marker at the WARN level.
 public  void warn(String format,
    Object arg1,
    Object arg2)
    Log a message at the WARN level according to the specified format and arguments.

    This form avoids superfluous object creation when the logger is disabled for the WARN level.

 public  void warn(Marker marker,
    String format,
    Object arg)
    This method is similar to #warn(String, Object) method except that the marker data is also taken into consideration.
 public  void warn(Marker marker,
    String format,
    Object[] argArray)
    This method is similar to #warn(String, Object[]) method except that the marker data is also taken into consideration.
 public  void warn(Marker marker,
    String msg,
    Throwable t)
 public  void warn(Marker marker,
    String format,
    Object arg1,
    Object arg2)