class DebugPoolFactory extends DefaultPoolFactory {

  @Override
  public ComboPooledDataSource create() throws Exception {
    ComboPooledDataSource result = super.create();
    result.setUnreturnedConnectionTimeout(unreturnedConnectionTimeout());
    result.setDebugUnreturnedConnectionStackTraces(debugUnreturnedConnectionStackTraces());
    result.setLogWriter(new PrintWriter(new Slf4jLoggingOutputStream(logger, "DEBUG"), true)); // lgtm
    return result;
  }

}