Interface Logger

All Known Implementing Classes:
ConsoleLogging.ConsoleLogger, DevNullLogger, JULogger, PrefixedLogger, ReformattedLogger

public interface Logger
Logs messages for driver activity.

Some methods in this interface take a message template together with a list of parameters. These methods are expected to construct the final message only if the needed logging level is enabled. Driver expects formatting to be done using String.format(String, Object...) method. Thus, all supplied message templates will contain "%s" as parameter placeholders. This is different from all SLF4J-compatible logging frameworks where parameter placeholder is "{}". Implementations of this interface should adapt placeholders from "%s" to "{}", if required.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String message, Object... params)
    Logs bolt messages sent and received by this driver.
    void
    debug(String message, Throwable throwable)
    Logs debug message with throwable.
    void
    error(String message, Throwable cause)
    Logs errors from this driver.
    void
    info(String message, Object... params)
    Logs information from the driver.
    boolean
    Return true if the debug level is enabled.
    boolean
    Return true if the trace logging level is enabled.
    void
    trace(String message, Object... params)
    Logs binary sent and received by this driver.
    void
    warn(String message, Object... params)
    Logs warnings that happened when using the driver.
    void
    warn(String message, Throwable cause)
    Logs warnings that happened during using the driver
  • Method Details

    • error

      void error(String message, Throwable cause)
      Logs errors from this driver.

      Examples of errors logged using this method:

      • Network connection errors
      • DNS resolution errors
      • Cluster discovery errors
      Parameters:
      message - the error message.
      cause - the cause of the error.
    • info

      void info(String message, Object... params)
      Logs information from the driver.

      Example of info messages logged using this method:

      • Driver creation and shutdown
      • Cluster discovery progress
      Parameters:
      message - the information message template. Can contain String.format(String, Object...)-style placeholders, like "%s".
      params - parameters used in the information message.
    • warn

      void warn(String message, Object... params)
      Logs warnings that happened when using the driver.

      Example of info messages logged using this method:

      • Usage of deprecated APIs
      • Transaction retry failures
      Parameters:
      message - the warning message template. Can contain String.format(String, Object...)-style placeholders, like "%s".
      params - parameters used in the warning message.
    • warn

      void warn(String message, Throwable cause)
      Logs warnings that happened during using the driver

      Example of info messages logged using this method:

      • Usage of deprecated APIs
      • Transaction retry failures
      Parameters:
      message - the warning message
      cause - the cause of the warning
    • debug

      void debug(String message, Object... params)
      Logs bolt messages sent and received by this driver. It is only enabled when isDebugEnabled() returns true. This logging level generates a lot of log entries.

      Example of debug messages logged using this method:

      • Connection pool events, like creation, acquire and release of connections
      • Messages sent to the database
      • Messages received from the database
      Parameters:
      message - the debug message template. Can contain String.format(String, Object...)-style placeholders, like "%s".
      params - parameters used in generating the bolt message
    • debug

      void debug(String message, Throwable throwable)
      Logs debug message with throwable.
      Parameters:
      message - the message to log
      throwable - the throwable to include into the log entry
    • trace

      void trace(String message, Object... params)
      Logs binary sent and received by this driver. It is only enabled when isTraceEnabled() returns true. This logging level generates huge amount of log entries.

      Example of debug messages logged using this method:

      • Idle connection pings
      • Server selection for load balancing
      • Messages sent to the database with bytes in hex
      • Messages received from the database with bytes in hex
      Parameters:
      message - the trace message template. Can contain String.format(String, Object...)-style placeholders, like "%s".
      params - parameters used in generating the hex message
    • isTraceEnabled

      boolean isTraceEnabled()
      Return true if the trace logging level is enabled.
      Returns:
      true if the trace logging level is enabled.
      See Also:
    • isDebugEnabled

      boolean isDebugEnabled()
      Return true if the debug level is enabled.
      Returns:
      true if the debug level is enabled.
      See Also: