Interface Log

All Known Implementing Classes:
JulLogAdapter, Log4j2LogAdapter

public interface Log
This is a borrowed and stripped-down version of the log4j2 Logger interface. All logging operations, except configuration, are done through this interface.

The canonical way to obtain a Logger for a class is through LogManager.getLog(String)}. Typically, each class should get its own Log named after its fully qualified class name

 public class MyClass {
     private static final Log log = LogManager.getLog(MyClass.class);
     // ...
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(Object message)
    Logs a message object with the DEBUG level.
    void
    debug(String message)
    Logs a message object with the DEBUG level.
    void
    debug(String message, Object... params)
    Logs a message with parameters at the DEBUG level.
    void
    debug(String message, Throwable t)
    Logs a message at the DEBUG level including the stack trace of the Throwable t passed as parameter.
    void
    debug(String message, Supplier<?>... paramSuppliers)
    Logs a message with parameters which are only to be constructed if the logging level is the DEBUG level.
    void
    error(Object message)
    Logs a message object with the ERROR level.
    void
    error(String message)
    Logs a message object with the ERROR level.
    void
    error(String message, Object... params)
    Logs a message with parameters at the ERROR level.
    void
    error(String message, Throwable t)
    Logs a message at the ERROR level including the stack trace of the Throwable t passed as parameter.
    void
    error(String message, Supplier<?>... paramSuppliers)
    Logs a message with parameters which are only to be constructed if the logging level is the ERROR level.
    void
    fatal(Object message)
    Logs a message object with the FATAL level.
    void
    fatal(String message)
    Logs a message object with the FATAL level.
    void
    fatal(String message, Object... params)
    Logs a message with parameters at the FATAL level.
    void
    fatal(String message, Throwable t)
    Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.
    void
    fatal(String message, Supplier<?>... paramSuppliers)
    Logs a message with parameters which are only to be constructed if the logging level is the FATAL level.
    Gets the logger name.
    void
    info(Object message)
    Logs a message object with the INFO level.
    void
    info(String message)
    Logs a message object with the INFO level.
    void
    info(String message, Object... params)
    Logs a message with parameters at the INFO level.
    void
    info(String message, Throwable t)
    Logs a message at the INFO level including the stack trace of the Throwable t passed as parameter.
    void
    info(String message, Supplier<?>... paramSuppliers)
    Logs a message with parameters which are only to be constructed if the logging level is the INFO level.
    boolean
    Checks whether this Logger is enabled for the DEBUG Level.
    boolean
    Checks whether this Logger is enabled for the ERROR Level.
    boolean
    Checks whether this Logger is enabled for the FATAL Level.
    boolean
    Checks whether this Logger is enabled for the INFO Level.
    boolean
    Checks whether this Logger is enabled for the TRACE level.
    boolean
    Checks whether this Logger is enabled for the WARN Level.
    void
    trace(Object message)
    Logs a message object with the TRACE level.
    void
    trace(String message)
    Logs a message object with the TRACE level.
    void
    trace(String message, Object... params)
    Logs a message with parameters at the TRACE level.
    void
    trace(String message, Throwable t)
    Logs a message at the TRACE level including the stack trace of the Throwable t passed as parameter.
    void
    trace(String message, Supplier<?>... paramSuppliers)
    Logs a message with parameters which are only to be constructed if the logging level is the TRACE level.
    void
    warn(Object message)
    Logs a message object with the WARN level.
    void
    warn(String message)
    Logs a message object with the WARN level.
    void
    warn(String message, Object... params)
    Logs a message with parameters at the WARN level.
    void
    warn(String message, Throwable t)
    Logs a message at the WARN level including the stack trace of the Throwable t passed as parameter.
    void
    warn(String message, Supplier<?>... paramSuppliers)
    Logs a message with parameters which are only to be constructed if the logging level is the WARN level.
  • Method Details

    • debug

      void debug(String message)
      Logs a message object with the DEBUG level.
      Parameters:
      message - the message string to log.
    • debug

      void debug(Object message)
      Logs a message object with the DEBUG level.
      Parameters:
      message - the message object to log.
    • debug

      void debug(String message, Object... params)
      Logs a message with parameters at the DEBUG level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
    • debug

      void debug(String message, Supplier<?>... paramSuppliers)
      Logs a message with parameters which are only to be constructed if the logging level is the DEBUG level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      paramSuppliers - An array of functions, which when called, produce the desired log message parameters.
    • debug

      void debug(String message, Throwable t)
      Logs a message at the DEBUG level including the stack trace of the Throwable t passed as parameter.
      Parameters:
      message - the message to log.
      t - the exception to log, including its stack trace.
    • error

      void error(String message)
      Logs a message object with the ERROR level.
      Parameters:
      message - the message string to log.
    • error

      void error(Object message)
      Logs a message object with the ERROR level.
      Parameters:
      message - the message object to log.
    • error

      void error(String message, Object... params)
      Logs a message with parameters at the ERROR level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
    • error

      void error(String message, Supplier<?>... paramSuppliers)
      Logs a message with parameters which are only to be constructed if the logging level is the ERROR level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      paramSuppliers - An array of functions, which when called, produce the desired log message parameters.
    • error

      void error(String message, Throwable t)
      Logs a message at the ERROR level including the stack trace of the Throwable t passed as parameter.
      Parameters:
      message - the message object to log.
      t - the exception to log, including its stack trace.
    • fatal

      void fatal(String message)
      Logs a message object with the FATAL level.
      Parameters:
      message - the message string to log.
    • fatal

      void fatal(Object message)
      Logs a message object with the FATAL level.
      Parameters:
      message - the message object to log.
    • fatal

      void fatal(String message, Object... params)
      Logs a message with parameters at the FATAL level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
    • fatal

      void fatal(String message, Supplier<?>... paramSuppliers)
      Logs a message with parameters which are only to be constructed if the logging level is the FATAL level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      paramSuppliers - An array of functions, which when called, produce the desired log message parameters.
    • fatal

      void fatal(String message, Throwable t)
      Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.
      Parameters:
      message - the message object to log.
      t - the exception to log, including its stack trace.
    • getName

      Gets the logger name.
      Returns:
      the logger name.
    • info

      void info(String message)
      Logs a message object with the INFO level.
      Parameters:
      message - the message string to log.
    • info

      void info(Object message)
      Logs a message object with the INFO level.
      Parameters:
      message - the message object to log.
    • info

      void info(String message, Object... params)
      Logs a message with parameters at the INFO level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
    • info

      void info(String message, Supplier<?>... paramSuppliers)
      Logs a message with parameters which are only to be constructed if the logging level is the INFO level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      paramSuppliers - An array of functions, which when called, produce the desired log message parameters.
    • info

      void info(String message, Throwable t)
      Logs a message at the INFO level including the stack trace of the Throwable t passed as parameter.
      Parameters:
      message - the message object to log.
      t - the exception to log, including its stack trace.
    • isDebugEnabled

      boolean isDebugEnabled()
      Checks whether this Logger is enabled for the DEBUG Level.
      Returns:
      boolean - true if this Logger is enabled for level DEBUG, false otherwise.
    • isErrorEnabled

      boolean isErrorEnabled()
      Checks whether this Logger is enabled for the ERROR Level.
      Returns:
      boolean - true if this Logger is enabled for level ERROR, false otherwise.
    • isFatalEnabled

      boolean isFatalEnabled()
      Checks whether this Logger is enabled for the FATAL Level.
      Returns:
      boolean - true if this Logger is enabled for level FATAL, false otherwise.
    • isInfoEnabled

      boolean isInfoEnabled()
      Checks whether this Logger is enabled for the INFO Level.
      Returns:
      boolean - true if this Logger is enabled for level INFO, false otherwise.
    • isTraceEnabled

      boolean isTraceEnabled()
      Checks whether this Logger is enabled for the TRACE level.
      Returns:
      boolean - true if this Logger is enabled for level TRACE, false otherwise.
    • isWarnEnabled

      boolean isWarnEnabled()
      Checks whether this Logger is enabled for the WARN Level.
      Returns:
      boolean - true if this Logger is enabled for level WARN, false otherwise.
    • trace

      void trace(String message)
      Logs a message object with the TRACE level.
      Parameters:
      message - the message string to log.
    • trace

      void trace(Object message)
      Logs a message object with the TRACE level.
      Parameters:
      message - the message object to log.
    • trace

      void trace(String message, Object... params)
      Logs a message with parameters at the TRACE level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
    • trace

      void trace(String message, Supplier<?>... paramSuppliers)
      Logs a message with parameters which are only to be constructed if the logging level is the TRACE level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      paramSuppliers - An array of functions, which when called, produce the desired log message parameters.
    • trace

      void trace(String message, Throwable t)
      Logs a message at the TRACE level including the stack trace of the Throwable t passed as parameter.
      Parameters:
      message - the message object to log.
      t - the exception to log, including its stack trace.
      See Also:
    • warn

      void warn(String message)
      Logs a message object with the WARN level.
      Parameters:
      message - the message string to log.
    • warn

      void warn(Object message)
      Logs a message object with the WARN level.
      Parameters:
      message - the message object to log.
    • warn

      void warn(String message, Object... params)
      Logs a message with parameters at the WARN level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
    • warn

      void warn(String message, Supplier<?>... paramSuppliers)
      Logs a message with parameters which are only to be constructed if the logging level is the WARN level.
      Parameters:
      message - the message to log; the format depends on the message factory.
      paramSuppliers - An array of functions, which when called, produce the desired log message parameters.
    • warn

      void warn(String message, Throwable t)
      Logs a message at the WARN level including the stack trace of the Throwable t passed as parameter.
      Parameters:
      message - the message object to log.
      t - the exception to log, including its stack trace.