Package 

Interface Logger

  • All Implemented Interfaces:

    
    public interface Logger
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • createChildLogger

         abstract Logger createChildLogger(String name, Map<String, String> context)

        Create a 'child' logger which derives from this one. The child logger will share the same log level setting as this one and its LogContext (given here) will, in addition to the values it contains, have the parent logger's context merged into it (the child's context values take priority in case of a conflict)

      • createChildLogger

         abstract Logger createChildLogger(String name)

        Create a 'child' logger which derives from this one. The child logger will share the same log level setting as this one and it will inherit this logger's LogContext

      • isTraceEnabled

         abstract boolean isTraceEnabled()

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

      • trace

         abstract void trace(Object msg)

        Log a TRACE message.

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

        Parameters:
        msg - The message to log
      • trace

         abstract void trace(Supplier<String> msgSupplier)

        Log a TRACE message. Only invokes the given supplier if the TRACE level is currently loggable.

        Parameters:
        msgSupplier - a Supplier which will return the log mesage when invoked
      • isDebugEnabled

         abstract boolean isDebugEnabled()

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

      • debug

         abstract void debug(Object msg)

        Log a DEBUG message.

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

        Parameters:
        msg - The message to log
      • debug

         abstract void debug(Supplier<String> msgSupplier)

        Log a DEBUG message. Only invokes the given supplier if the DEBUG level is currently loggable.

        Parameters:
        msgSupplier - a Supplier which will return the log mesage when invoked
      • isInfoEnabled

         abstract boolean isInfoEnabled()

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

      • info

         abstract void info(Object msg)

        Log an INFO message.

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

        Parameters:
        msg - The message to log
      • info

         abstract void info(Supplier<String> msgSupplier)

        Log an INFO message. Only invokes the given supplier if the INFO level is currently loggable.

        Parameters:
        msgSupplier - a Supplier which will return the log mesage when invoked
      • isWarnEnabled

         abstract boolean isWarnEnabled()

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

      • warn

         abstract void warn(Object msg)

        Log a WARN message.

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

        Parameters:
        msg - The message to log
      • warn

         abstract void warn(Supplier<String> msgSupplier)

        Log a WARN message. Only invokes the given supplier if the WARN level is currently loggable.

        Parameters:
        msgSupplier - a Supplier which will return the log mesage when invoked
      • warn

         abstract 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

         abstract void error(Object msg)

        Log a ERROR message.

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

        Parameters:
        msg - The message to log
      • error

         abstract void error(Supplier<String> msgSupplier)

        Log an ERROR message. Only invokes the given supplier if the ERROR level is currently loggable.

        Parameters:
        msgSupplier - a Supplier which will return the log mesage when invoked
      • error

         abstract 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.
      • setLevelError

         abstract void setLevelError()

        Set logging level for all handlers to ERROR

      • setLevelWarn

         abstract void setLevelWarn()

        Set logging level for all handlers to WARNING

      • setLevelInfo

         abstract void setLevelInfo()

        Set logging level for all handlers to INFO

      • setLevelDebug

         abstract void setLevelDebug()

        Set logging level for all handlers to DEBUG

      • setLevelTrace

         abstract void setLevelTrace()

        Set logging level for all handlers to TRACE

      • setLevelAll

         abstract void setLevelAll()

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

      • setLevelOff

         abstract void setLevelOff()

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

      • setLevel

         abstract void setLevel(Level level)

        Set logging level for all handlers to level

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

         abstract void addContext(Map<String, String> addedContext)

        Add additional log context to this logger

        Parameters:
        addedContext - a map of key, value pairs of the key names and values to add
      • addContext

         abstract void addContext(String key, String value)

        Add additional log context to this logger

        Parameters:
        key - the context key
        value - the context value