org.apache.cayenne.access

## Class QueryLogger

- java.lang.Object
- - org.apache.cayenne.access.QueryLogger

- Deprecated.
  since 3.1 replaced by injectable `JdbcEventLogger`.

      @Deprecated
      public class QueryLogger
      extends Object

  A static wrapper around `JdbcEventLogger`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryLogger()` Deprecated.

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JdbcEventLogger` | `getLogger()` Deprecated.
    `static boolean` | `isLoggable()` Deprecated. Returns true if current thread default log level is high enough for QueryLogger to generate output.
    `static void` | `log(String message)` Deprecated.
    `static void` | `logBeginTransaction(String transactionLabel)` Deprecated.
    `static void` | `logCommitTransaction(String transactionLabel)` Deprecated.
    `static void` | `logConnect(String dataSource)` Deprecated. Logs database connection event using container data source.
    `static void` | `logConnect(String url, String userName, String password)` Deprecated.
    `static void` | `logConnectFailure(Throwable th)` Deprecated.
    `static void` | `logConnectSuccess()` Deprecated.
    `static void` | `logGeneratedKey(DbAttribute attribute, Object value)` Deprecated.
    `static void` | `logPoolCreated(DataSourceInfo dsi)` Deprecated. Logs database connection event.
    `static void` | `logQuery(String queryStr, List<?> params)` Deprecated.
    `static void` | `logQuery(String queryStr, List<DbAttribute> attrs, List<?> params, long time)` Deprecated. Log query content using Log4J Category with "INFO" priority.
    `static void` | `logQueryError(Throwable th)` Deprecated.
    `static void` | `logQueryParameters(String label, List<DbAttribute> attrs, List<Object> parameters, boolean isInserting)` Deprecated.
    `static void` | `logQueryStart(int count)` Deprecated.
    `static void` | `logRollbackTransaction(String transactionLabel)` Deprecated.
    `static void` | `logSelectCount(int count)` Deprecated.
    `static void` | `logSelectCount(int count, long time)` Deprecated.
    `static void` | `logUpdateCount(int count)` Deprecated.
    `static void` | `setLogger(JdbcEventLogger logger)` Deprecated.
    `static void` | `sqlLiteralForObject(StringBuffer buffer, Object object)` Deprecated. Appends SQL literal for the specified object to the buffer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### QueryLogger

          public QueryLogger()

      Deprecated.

  - ### Method Detail

    - #### setLogger

          public static void setLogger(JdbcEventLogger logger)

      Deprecated.

    - #### getLogger

          public static JdbcEventLogger getLogger()

      Deprecated.

    - #### sqlLiteralForObject

          public static void sqlLiteralForObject(StringBuffer buffer,
                                                 Object object)

      Deprecated.
      Appends SQL literal for the specified object to the buffer. This is a utility method and is not intended to build SQL queries, rather this is used in logging routines. In particular it will trim large values to avoid flooding the logs.
      Parameters:
        `buffer` - buffer to append value
        `object` - object to be transformed to SQL literal.

    - #### log

          public static void log(String message)

      Deprecated.
      Since:
        1.2 logs an arbitrary message using logging level setup for QueryLogger.

    - #### logConnect

          public static void logConnect(String dataSource)

      Deprecated.
      Logs database connection event using container data source.
      Since:
        1.2

    - #### logConnect

          public static void logConnect(String url,
                                        String userName,
                                        String password)

      Deprecated.
      Since:
        1.2

    - #### logPoolCreated

          public static void logPoolCreated(DataSourceInfo dsi)

      Deprecated.
      Logs database connection event.
      Since:
        1.2

    - #### logConnectSuccess

          public static void logConnectSuccess()

      Deprecated.
      Since:
        1.2

    - #### logConnectFailure

          public static void logConnectFailure(Throwable th)

      Deprecated.
      Since:
        1.2

    - #### logGeneratedKey

          public static void logGeneratedKey(DbAttribute attribute,
                                             Object value)

      Deprecated.
      Since:
        3.0

    - #### logQuery

          public static void logQuery(String queryStr,
                                      List<?> params)

      Deprecated.
      Since:
        1.2

    - #### logQuery

          public static void logQuery(String queryStr,
                                      List<DbAttribute> attrs,
                                      List<?> params,
                                      long time)

      Deprecated.
      Log query content using Log4J Category with "INFO" priority.
      Parameters:
        `queryStr` - Query SQL string
        `attrs` - optional list of DbAttribute (can be null)
        `params` - optional list of query parameters that are used when executing query in prepared statement.
      Since:
        1.2

    - #### logQueryParameters

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

      Deprecated.
      Since:
        1.2

    - #### logSelectCount

          public static void logSelectCount(int count)

      Deprecated.
      Since:
        1.2

    - #### logSelectCount

          public static void logSelectCount(int count,
                                            long time)

      Deprecated.
      Since:
        1.2

    - #### logUpdateCount

          public static void logUpdateCount(int count)

      Deprecated.
      Since:
        1.2

    - #### logBeginTransaction

          public static void logBeginTransaction(String transactionLabel)

      Deprecated.
      Since:
        1.2

    - #### logCommitTransaction

          public static void logCommitTransaction(String transactionLabel)

      Deprecated.
      Since:
        1.2

    - #### logRollbackTransaction

          public static void logRollbackTransaction(String transactionLabel)

      Deprecated.
      Since:
        1.2

    - #### logQueryError

          public static void logQueryError(Throwable th)

      Deprecated.
      Since:
        1.2

    - #### logQueryStart

          public static void logQueryStart(int count)

      Deprecated.
      Since:
        1.2

    - #### isLoggable

          public static boolean isLoggable()

      Deprecated.
      Returns true if current thread default log level is high enough for QueryLogger to generate output.
      Since:
        1.2

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