Class SwallowedExceptionLogger

java.lang.Object
org.apache.commons.dbcp2.SwallowedExceptionLogger
All Implemented Interfaces:
org.apache.commons.pool2.SwallowedExceptionListener

public class SwallowedExceptionLogger extends Object implements org.apache.commons.pool2.SwallowedExceptionListener
Class for logging swallowed exceptions.
Since:
2.0
  • Field Details

    • log

      private final org.apache.commons.logging.Log log
    • logExpiredConnections

      private final boolean logExpiredConnections
  • Constructor Details

    • SwallowedExceptionLogger

      public SwallowedExceptionLogger(org.apache.commons.logging.Log log)
      Create a SwallowedExceptionLogger with the given logger. By default, expired connection logging is turned on.
      Parameters:
      log - logger
    • SwallowedExceptionLogger

      public SwallowedExceptionLogger(org.apache.commons.logging.Log log, boolean logExpiredConnections)
      Create a SwallowedExceptionLogger with the given logger and expired connection logging property.
      Parameters:
      log - logger
      logExpiredConnections - false suppresses logging of expired connection events
  • Method Details

    • onSwallowException

      public void onSwallowException(Exception e)
      Specified by:
      onSwallowException in interface org.apache.commons.pool2.SwallowedExceptionListener