Package com.pyranid

Class DefaultStatementLogger

java.lang.Object
com.pyranid.DefaultStatementLogger
All Implemented Interfaces:
StatementLogger

@ThreadSafe public class DefaultStatementLogger extends Object implements StatementLogger
Basic implementation of StatementLogger which logs via java.util.logging.
Since:
1.0.0
Author:
Mark Allen
  • Field Details

  • Constructor Details

    • DefaultStatementLogger

      Creates a new statement logger with the default logger name "com.pyranid.SQL" and level.
    • DefaultStatementLogger

      public DefaultStatementLogger(@Nonnull String loggerName, @Nonnull Level loggerLevel)
      Creates a new statement logger with the given logger name and level.
      Parameters:
      loggerName - the logger name to use
      loggerLevel - the logger level to use
  • Method Details

    • log

      public void log(@Nonnull StatementLog statementLog)
      Description copied from interface: StatementLogger
      Performs a logging operation on the given statementLog.

      Implementors might choose to no-op, write to stdout or a logging framework, send alerts about slow queries, and so on.

      Specified by:
      log in interface StatementLogger
      Parameters:
      statementLog - The event to log