org.apache.cayenne.log

## Interface JdbcEventLogger

- All Known Implementing Classes:
    FormattedSlf4jJdbcEventLogger, NoopJdbcEventLogger, Slf4jJdbcEventLogger

      public interface JdbcEventLogger

  A logging service used by Cayenne to output database interactions.
  Since:
    3.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isLoggable()` Returns true if current thread default log level is high enough to generate output.
    `void` | `log(String message)` Logs an arbitrary message.
    `void` | `logBeginTransaction(String transactionLabel)`
    `void` | `logCommitTransaction(String transactionLabel)`
    `void` | `logConnect(String dataSource)` Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.
    `void` | `logConnect(String url, String userName, String password)` Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.
    `void` | `logConnectFailure(Throwable th)` Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.
    `void` | `logConnectSuccess()` Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.
    `void` | `logGeneratedKey(DbAttribute attribute, Object value)`
    `void` | `logPoolCreated(DataSourceInfo dsi)` Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.
    `void` | `logQuery(String sql, List<?> params)` Deprecated. since 4.0 use `logQuery(String, ParameterBinding[])`.
    `void` | `logQuery(String sql, List<DbAttribute> attrs, List<?> params, long time)` Deprecated. since 4.0 use `logQuery(String, ParameterBinding[])`.
    `void` | `logQuery(String sql, ParameterBinding[] bindings)`
    `void` | `logQueryError(Throwable th)`
    `void` | `logQueryParameters(String label, List<DbAttribute> attrs, List<Object> parameters, boolean isInserting)` Deprecated. since 4.0 use `logQueryParameters(String, ParameterBinding[])`
    `void` | `logQueryParameters(String label, ParameterBinding[] bindings)`
    `void` | `logRollbackTransaction(String transactionLabel)`
    `void` | `logSelectCount(int count, long time)`
    `void` | `logSelectCount(int count, long time, String sql)`
    `void` | `logUpdateCount(int count)`

- - ### Method Detail

    - #### log

          void log(String message)

      Logs an arbitrary message.

    - #### logConnect

          @Deprecated
          void logConnect(String dataSource)

      Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.
      Logs database connection event using container data source.

    - #### logConnect

          @Deprecated
          void logConnect(String url,
                                       String userName,
                                       String password)

      Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.

    - #### logPoolCreated

          @Deprecated
          void logPoolCreated(DataSourceInfo dsi)

      Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.

    - #### logConnectSuccess

          @Deprecated
          void logConnectSuccess()

      Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.

    - #### logConnectFailure

          @Deprecated
          void logConnectFailure(Throwable th)

      Deprecated. since 4.0 connection events are logged by the DataSources using their own logger.

    - #### logGeneratedKey

          void logGeneratedKey(DbAttribute attribute,
                               Object value)

    - #### logQuery

          @Deprecated
          void logQuery(String sql,
                                     List<?> params)

      Deprecated. since 4.0 use `logQuery(String, ParameterBinding[])`.

    - #### logQuery

          @Deprecated
          void logQuery(String sql,
                                     List<DbAttribute> attrs,
                                     List<?> params,
                                     long time)

      Deprecated. since 4.0 use `logQuery(String, ParameterBinding[])`.

    - #### logQuery

          void logQuery(String sql,
                        ParameterBinding[] bindings)

      Since:
        4.0

    - #### logQueryParameters

          void logQueryParameters(String label,
                                  ParameterBinding[] bindings)

      Since:
        4.0

    - #### logQueryParameters

          @Deprecated
          void logQueryParameters(String label,
                                               List<DbAttribute> attrs,
                                               List<Object> parameters,
                                               boolean isInserting)

      Deprecated. since 4.0 use `logQueryParameters(String, ParameterBinding[])`

    - #### logSelectCount

          void logSelectCount(int count,
                              long time)

    - #### logSelectCount

          void logSelectCount(int count,
                              long time,
                              String sql)

      Parameters:
        `count` - of selected rows
        `time` - (milliseconds) time query took to run
        `sql` - SQL that was executed, printed when time exceeds timeThreshold
      Since:
        4.0

    - #### logUpdateCount

          void logUpdateCount(int count)

    - #### logBeginTransaction

          void logBeginTransaction(String transactionLabel)

    - #### logCommitTransaction

          void logCommitTransaction(String transactionLabel)

    - #### logRollbackTransaction

          void logRollbackTransaction(String transactionLabel)

    - #### logQueryError

          void logQueryError(Throwable th)

    - #### isLoggable

          boolean isLoggable()

      Returns true if current thread default log level is high enough to generate output.

Copyright © 2001–2023 Apache Cayenne. All rights reserved.