Package 

Class Logger


  • 
    public abstract class Logger
    
                        

    Standard logging methods.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum Logger.Category

      An enumeration of different categories for log messages.

    • Method Summary

      Modifier and Type Method Description
      static Logger getLogger(Class<out Object> clazz) Create a logger for the specified class.
      static Logger getLogger(String name) Create a logger for the specified name.
      static Logger getLogger(Logger loggingDelegate, Logger levelDelegate) Creates a new Logger instance which performs logging through {@code loggingDelegate} and uses {@code levelDelegate} to configure itslevel.
      void logEntry() Logs an entry in the calling method.
      void logExit() Logs exiting the calling method
      boolean isTraceEnabled() Check if a message with a TRACE level would actually be logged by thislogger.
      void trace(Object msg) Log a TRACE message.
      void trace(Object msg, Throwable t) Log a message, with associated Throwable information.
      boolean isDebugEnabled() Check if a message with a DEBUG level would actually be logged by thislogger.
      void debug(Object msg) Log a DEBUG message.
      void debug(Object msg, Throwable t) Log a message, with associated Throwable information.
      boolean isInfoEnabled() Check if a message with an INFO level would actually be logged by thislogger.
      void info(Object msg) Log a INFO message.
      void info(Object msg, Throwable t) Log a message, with associated Throwable information.
      boolean isWarnEnabled() Check if a message with a WARN level would actually be logged by thislogger.
      void warn(Object msg) Log a WARN message.
      void warn(Object msg, Throwable t) Log a message, with associated Throwable information.
      void error(Object msg) Log a ERROR message.
      void error(Object msg, Throwable t) Log a message, with associated Throwable information.
      void fatal(Object msg) Log a FATAL message.
      void fatal(Object msg, Throwable t) Log a message, with associated Throwable information.
      void setLevelFatal() Set logging level for all handlers to FATAL
      void setLevelError() Set logging level for all handlers to ERROR
      void setLevelWarn() Set logging level for all handlers to WARNING
      void setLevelInfo() Set logging level for all handlers to INFO
      void setLevelDebug() Set logging level for all handlers to DEBUG
      void setLevelTrace() Set logging level for all handlers to TRACE
      void setLevelAll() Set logging level for all handlers to ALL (allow all log messages)
      void setLevelOff() Set logging level for all handlers to OFF (allow no log messages)
      void reset() Reinitialize the logging properties and reread the logging configuration.
      abstract void setLevel(Level level) Set logging level for all handlers to level
      abstract Level getLevel()
      abstract void log(Level level, Object msg) Logs a message at a given level, if that level is loggable according tothe log level configured by this instance.
      abstract void log(Level level, Object msg, Throwable thrown) Logs a message at a given level, if that level is loggable according tothe log level configured by this instance.
      void log(Level level, Logger.Category category, String msg) Logs a given message with and given category at a given level, if thatlevel is loggable according to the log level configured by this instance.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void log(Level level, Logger.Category category, String msg, Throwable thrown) Logs a given message with and given category at a given level, if thatlevel is loggable according to the log level configured by this instance.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void debug(Logger.Category category, String msg) Log a message with debug level.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void debug(Logger.Category category, String msg, Throwable t) Log a message with debug level, with associated Throwable information.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void error(Logger.Category category, String msg) Log a message with error level.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void error(Logger.Category category, String msg, Throwable t) Log a message with error level, with associated Throwable information.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void info(Logger.Category category, String msg, Throwable t) Log a message with info level, with associated Throwable information.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      void info(Logger.Category category, String msg) Log a message with info level.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getLogger

         static Logger getLogger(Class<out Object> clazz)

        Create a logger for the specified class.

        Parameters:
        clazz - The class for which to create a logger.
      • getLogger

         static Logger getLogger(Logger loggingDelegate, Logger levelDelegate)

        Creates a new Logger instance which performs logging through {@code loggingDelegate} and uses {@code levelDelegate} to configure itslevel.

        Parameters:
        loggingDelegate - the Logger used for logging.
        levelDelegate - the Logger used for configuring the loglevel.
      • logEntry

         void logEntry()

        Logs an entry in the calling method.

      • logExit

         void logExit()

        Logs exiting the calling method

      • isTraceEnabled

         boolean isTraceEnabled()

        Check if a message with a TRACE level would actually be logged by thislogger.

      • trace

         void trace(Object msg)

        Log a TRACE message.

        If the logger is currently enabled for the TRACE messagelevel then the given message is forwarded to all theregistered output Handler objects.

        Parameters:
        msg - The message to log
      • trace

         void trace(Object msg, Throwable t)

        Log a message, with associated Throwable information.

        Parameters:
        msg - The message to log
        t - Throwable associated with log message.
      • isDebugEnabled

         boolean isDebugEnabled()

        Check if a message with a DEBUG level would actually be logged by thislogger.

      • debug

         void debug(Object msg)

        Log a DEBUG message.

        If the logger is currently enabled for the DEBUG messagelevel then the given message is forwarded to all theregistered output Handler objects.

        Parameters:
        msg - The message to log
      • debug

         void debug(Object msg, Throwable t)

        Log a message, with associated Throwable information.

        Parameters:
        msg - The message to log
        t - Throwable associated with log message.
      • isInfoEnabled

         boolean isInfoEnabled()

        Check if a message with an INFO level would actually be logged by thislogger.

      • info

         void info(Object msg)

        Log a INFO message.

        If the logger is currently enabled for the INFO messagelevel then the given message is forwarded to all theregistered output Handler objects.

        Parameters:
        msg - The message to log
      • info

         void info(Object msg, Throwable t)

        Log a message, with associated Throwable information.

        Parameters:
        msg - The message to log
        t - Throwable associated with log message.
      • isWarnEnabled

         boolean isWarnEnabled()

        Check if a message with a WARN level would actually be logged by thislogger.

      • warn

         void warn(Object msg)

        Log a WARN message.

        If the logger is currently enabled for the WARN messagelevel then the given message is forwarded to all theregistered output Handler objects.

        Parameters:
        msg - The message to log
      • warn

         void warn(Object msg, Throwable t)

        Log a message, with associated Throwable information.

        Parameters:
        msg - The message to log
        t - Throwable associated with log message.
      • error

         void error(Object msg)

        Log a ERROR message.

        If the logger is currently enabled for the ERROR messagelevel then the given message is forwarded to all theregistered output Handler objects.

        Parameters:
        msg - The message to log
      • error

         void error(Object msg, Throwable t)

        Log a message, with associated Throwable information.

        Parameters:
        msg - The message to log
        t - Throwable associated with log message.
      • fatal

         void fatal(Object msg)

        Log a FATAL message.

        If the logger is currently enabled for the FATAL messagelevel then the given message is forwarded to all theregistered output Handler objects.

        Parameters:
        msg - The message to log
      • fatal

         void fatal(Object msg, Throwable t)

        Log a message, with associated Throwable information.

        Parameters:
        msg - The message to log
        t - Throwable associated with log message.
      • setLevelFatal

         void setLevelFatal()

        Set logging level for all handlers to FATAL

      • setLevelError

         void setLevelError()

        Set logging level for all handlers to ERROR

      • setLevelWarn

         void setLevelWarn()

        Set logging level for all handlers to WARNING

      • setLevelInfo

         void setLevelInfo()

        Set logging level for all handlers to INFO

      • setLevelDebug

         void setLevelDebug()

        Set logging level for all handlers to DEBUG

      • setLevelTrace

         void setLevelTrace()

        Set logging level for all handlers to TRACE

      • setLevelAll

         void setLevelAll()

        Set logging level for all handlers to ALL (allow all log messages)

      • setLevelOff

         void setLevelOff()

        Set logging level for all handlers to OFF (allow no log messages)

      • reset

         void reset()

        Reinitialize the logging properties and reread the logging configuration.

        The same rules are used for locating the configuration propertiesas are used at startup. So if the properties containing the log dirlocations have changed, we would read the new configuration.

      • setLevel

         abstract void setLevel(Level level)

        Set logging level for all handlers to level

        Parameters:
        level - the level to set for all logger handlers
      • log

         abstract void log(Level level, Object msg)

        Logs a message at a given level, if that level is loggable according tothe log level configured by this instance.

        Parameters:
        level - the level at which to log the message.
        msg - the message to log.
      • log

         abstract void log(Level level, Object msg, Throwable thrown)

        Logs a message at a given level, if that level is loggable according tothe log level configured by this instance.

        Parameters:
        level - the level at which to log the message.
        msg - the message to log.
        thrown - a Throwable associated with log message.
      • log

         void log(Level level, Logger.Category category, String msg)

        Logs a given message with and given category at a given level, if thatlevel is loggable according to the log level configured by this instance.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        level - the level at which to log the message.
        category - the category.
        msg - the message to log.
      • log

         void log(Level level, Logger.Category category, String msg, Throwable thrown)

        Logs a given message with and given category at a given level, if thatlevel is loggable according to the log level configured by this instance.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        level - the level at which to log the message.
        category - the category.
        msg - the message to log.
        thrown - a Throwable associated with log message.
      • debug

         void debug(Logger.Category category, String msg)

        Log a message with debug level.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        category - the category.
        msg - The message to log
      • debug

         void debug(Logger.Category category, String msg, Throwable t)

        Log a message with debug level, with associated Throwable information.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        category - the category.
        msg - The message to log
        t - Throwable associated with log message.
      • error

         void error(Logger.Category category, String msg)

        Log a message with error level.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        category - the category.
        msg - The message to log
      • error

         void error(Logger.Category category, String msg, Throwable t)

        Log a message with error level, with associated Throwable information.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        category - the category.
        msg - The message to log
        t - Throwable associated with log message.
      • info

         void info(Logger.Category category, String msg, Throwable t)

        Log a message with info level, with associated Throwable information.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        category - the category.
        msg - The message to log
        t - Throwable associated with log message.
      • info

         void info(Logger.Category category, String msg)

        Log a message with info level.An identifier of the category in the form of CAT=name will will simplybe prepended to the message.

        Parameters:
        category - the category.
        msg - The message to log