Class Logger


  • public final class Logger
    extends Object
    All logging is handled through this class. This class wraps an actual logging implementation or logging framework so that implementations can be swapped out without having to modify classes that use this logging mechanism. Note, if Markers are used, the logging implementation will be tied to SLF4j.
    Since:
    1.0.0
    Author:
    Steve Springett
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(String message)
      Log a message at the DEBUG level.
      void debug​(String message, Throwable throwable)
      Log a message at the DEBUG level.
      void debug​(org.slf4j.Marker marker, String message)
      Log a message at the DEBUG level.
      void debug​(org.slf4j.Marker marker, String message, Object object)
      Log a message at the DEBUG level.
      void debug​(org.slf4j.Marker marker, String message, Object... objects)
      Log a message at the DEBUG level.
      void debug​(org.slf4j.Marker marker, String message, Object o1, Object o2)
      Log a message at the DEBUG level.
      void debug​(org.slf4j.Marker marker, String message, Throwable throwable)
      Log a message at the DEBUG level.
      void error​(String message)
      Log a message at the ERROR level.
      void error​(String message, Throwable throwable)
      Log a message at the ERROR level.
      void error​(org.slf4j.Marker marker, String message)
      Log a message at the ERROR level.
      void error​(org.slf4j.Marker marker, String message, Object object)
      Log a message at the ERROR level.
      void error​(org.slf4j.Marker marker, String message, Object... objects)
      Log a message at the ERROR level.
      void error​(org.slf4j.Marker marker, String message, Object o1, Object o2)
      Log a message at the ERROR level.
      void error​(org.slf4j.Marker marker, String message, Throwable throwable)
      Log a message at the ERROR level.
      static Logger getLogger​(Class<?> clazz)
      Create an instance of this class and initialize the underlying logging framework.
      void info​(String message)
      Log a message at the INFO level.
      void info​(String message, Throwable throwable)
      Log a message at the INFO level.
      void info​(org.slf4j.Marker marker, String message)
      Log a message at the INFO level.
      void info​(org.slf4j.Marker marker, String message, Object object)
      Log a message at the INFO level.
      void info​(org.slf4j.Marker marker, String message, Object... objects)
      Log a message at the INFO level.
      void info​(org.slf4j.Marker marker, String message, Object o1, Object o2)
      Log a message at the INFO level.
      void info​(org.slf4j.Marker marker, String message, Throwable throwable)
      Log a message at the INFO level.
      boolean isDebugEnabled()
      Is the logger instance enabled for the DEBUG level?
      boolean isErrorEnabled()
      Is the logger instance enabled for the ERROR level?
      boolean isInfoEnabled()
      Is the logger instance enabled for the INFO level?
      boolean isTraceEnabled()
      Is the logger instance enabled for the TRACE level?
      boolean isWarnEnabled()
      Is the logger instance enabled for the WARN level?
      void trace​(String message)
      Log a message at the TRACE level.
      void trace​(String message, Throwable throwable)
      Log a message at the TRACE level.
      void trace​(org.slf4j.Marker marker, String message)
      Log a message at the TRACE level.
      void trace​(org.slf4j.Marker marker, String message, Object object)
      Log a message at the TRACE level.
      void trace​(org.slf4j.Marker marker, String message, Object... objects)
      Log a message at the TRACE level.
      void trace​(org.slf4j.Marker marker, String message, Object o1, Object o2)
      Log a message at the TRACE level.
      void trace​(org.slf4j.Marker marker, String message, Throwable throwable)
      Log a message at the TRACE level.
      void warn​(String message)
      Log a message at the WARN level.
      void warn​(String message, Throwable throwable)
      Log a message at the WARN level.
      void warn​(org.slf4j.Marker marker, String message)
      Log a message at the WARN level.
      void warn​(org.slf4j.Marker marker, String message, Object object)
      Log a message at the WARN level.
      void warn​(org.slf4j.Marker marker, String message, Object... objects)
      Log a message at the WARN level.
      void warn​(org.slf4j.Marker marker, String message, Object o1, Object o2)
      Log a message at the WARN level.
      void warn​(org.slf4j.Marker marker, String message, Throwable throwable)
      Log a message at the WARN level.
    • Method Detail

      • getLogger

        public static Logger getLogger​(Class<?> clazz)
        Create an instance of this class and initialize the underlying logging framework.
        Parameters:
        clazz - The class to use when writing log information
        Returns:
        An instance of the Logger class
        Since:
        1.0.0
      • isInfoEnabled

        public boolean isInfoEnabled()
        Is the logger instance enabled for the INFO level?
        Returns:
        True if this Logger is enabled for the INFO level, false otherwise.
        Since:
        1.0.0
      • isDebugEnabled

        public boolean isDebugEnabled()
        Is the logger instance enabled for the DEBUG level?
        Returns:
        True if this Logger is enabled for the DEBUG level, false otherwise.
        Since:
        1.0.0
      • isErrorEnabled

        public boolean isErrorEnabled()
        Is the logger instance enabled for the ERROR level?
        Returns:
        True if this Logger is enabled for the ERROR level, false otherwise.
        Since:
        1.0.0
      • isTraceEnabled

        public boolean isTraceEnabled()
        Is the logger instance enabled for the TRACE level?
        Returns:
        True if this Logger is enabled for the TRACE level, false otherwise.
        Since:
        1.0.0
      • isWarnEnabled

        public boolean isWarnEnabled()
        Is the logger instance enabled for the WARN level?
        Returns:
        True if this Logger is enabled for the WARN level, false otherwise.
        Since:
        1.0.0
      • info

        public void info​(String message)
        Log a message at the INFO level.
        Parameters:
        message - the message string to be logged
        Since:
        1.0.0
      • info

        public void info​(String message,
                         Throwable throwable)
        Log a message at the INFO level.
        Parameters:
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • info

        public void info​(org.slf4j.Marker marker,
                         String message)
        Log a message at the INFO level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        Since:
        1.0.0
      • info

        public void info​(org.slf4j.Marker marker,
                         String message,
                         Object object)
        Log a message at the INFO level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        object - the argument
        Since:
        1.0.0
      • info

        public void info​(org.slf4j.Marker marker,
                         String message,
                         Object o1,
                         Object o2)
        Log a message at the INFO level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        o1 - the first argument
        o2 - the second argument
        Since:
        1.0.0
      • info

        public void info​(org.slf4j.Marker marker,
                         String message,
                         Object... objects)
        Log a message at the INFO level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        objects - a list of 3 or more arguments
        Since:
        1.0.0
      • info

        public void info​(org.slf4j.Marker marker,
                         String message,
                         Throwable throwable)
        Log a message at the INFO level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • debug

        public void debug​(String message)
        Log a message at the DEBUG level.
        Parameters:
        message - the message string to be logged
        Since:
        1.0.0
      • debug

        public void debug​(String message,
                          Throwable throwable)
        Log a message at the DEBUG level.
        Parameters:
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • debug

        public void debug​(org.slf4j.Marker marker,
                          String message)
        Log a message at the DEBUG level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        Since:
        1.0.0
      • debug

        public void debug​(org.slf4j.Marker marker,
                          String message,
                          Object object)
        Log a message at the DEBUG level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        object - the argument
        Since:
        1.0.0
      • debug

        public void debug​(org.slf4j.Marker marker,
                          String message,
                          Object o1,
                          Object o2)
        Log a message at the DEBUG level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        o1 - the first argument
        o2 - the second argument
        Since:
        1.0.0
      • debug

        public void debug​(org.slf4j.Marker marker,
                          String message,
                          Object... objects)
        Log a message at the DEBUG level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        objects - a list of 3 or more arguments
        Since:
        1.0.0
      • debug

        public void debug​(org.slf4j.Marker marker,
                          String message,
                          Throwable throwable)
        Log a message at the DEBUG level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • error

        public void error​(String message)
        Log a message at the ERROR level.
        Parameters:
        message - the message string to be logged
        Since:
        1.0.0
      • error

        public void error​(String message,
                          Throwable throwable)
        Log a message at the ERROR level.
        Parameters:
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • error

        public void error​(org.slf4j.Marker marker,
                          String message)
        Log a message at the ERROR level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        Since:
        1.0.0
      • error

        public void error​(org.slf4j.Marker marker,
                          String message,
                          Object object)
        Log a message at the ERROR level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        object - the argument
        Since:
        1.0.0
      • error

        public void error​(org.slf4j.Marker marker,
                          String message,
                          Object o1,
                          Object o2)
        Log a message at the ERROR level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        o1 - the first argument
        o2 - the second argument
        Since:
        1.0.0
      • error

        public void error​(org.slf4j.Marker marker,
                          String message,
                          Object... objects)
        Log a message at the ERROR level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        objects - a list of 3 or more arguments
        Since:
        1.0.0
      • error

        public void error​(org.slf4j.Marker marker,
                          String message,
                          Throwable throwable)
        Log a message at the ERROR level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • trace

        public void trace​(String message)
        Log a message at the TRACE level.
        Parameters:
        message - the message string to be logged
        Since:
        1.0.0
      • trace

        public void trace​(String message,
                          Throwable throwable)
        Log a message at the TRACE level.
        Parameters:
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • trace

        public void trace​(org.slf4j.Marker marker,
                          String message)
        Log a message at the TRACE level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        Since:
        1.0.0
      • trace

        public void trace​(org.slf4j.Marker marker,
                          String message,
                          Object object)
        Log a message at the TRACE level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        object - the argument
        Since:
        1.0.0
      • trace

        public void trace​(org.slf4j.Marker marker,
                          String message,
                          Object o1,
                          Object o2)
        Log a message at the TRACE level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        o1 - the first argument
        o2 - the second argument
        Since:
        1.0.0
      • trace

        public void trace​(org.slf4j.Marker marker,
                          String message,
                          Object... objects)
        Log a message at the TRACE level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        objects - a list of 3 or more arguments
        Since:
        1.0.0
      • trace

        public void trace​(org.slf4j.Marker marker,
                          String message,
                          Throwable throwable)
        Log a message at the TRACE level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • warn

        public void warn​(String message)
        Log a message at the WARN level.
        Parameters:
        message - the message string to be logged
        Since:
        1.0.0
      • warn

        public void warn​(String message,
                         Throwable throwable)
        Log a message at the WARN level.
        Parameters:
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0
      • warn

        public void warn​(org.slf4j.Marker marker,
                         String message)
        Log a message at the WARN level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        Since:
        1.0.0
      • warn

        public void warn​(org.slf4j.Marker marker,
                         String message,
                         Object object)
        Log a message at the WARN level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        object - the argument
        Since:
        1.0.0
      • warn

        public void warn​(org.slf4j.Marker marker,
                         String message,
                         Object o1,
                         Object o2)
        Log a message at the WARN level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        o1 - the first argument
        o2 - the second argument
        Since:
        1.0.0
      • warn

        public void warn​(org.slf4j.Marker marker,
                         String message,
                         Object... objects)
        Log a message at the WARN level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        objects - a list of 3 or more arguments
        Since:
        1.0.0
      • warn

        public void warn​(org.slf4j.Marker marker,
                         String message,
                         Throwable throwable)
        Log a message at the WARN level.
        Parameters:
        marker - The marker specific to this log statement
        message - the message string to be logged
        throwable - the exception (throwable) to log
        Since:
        1.0.0