Package org.apache.cayenne.log
Class Slf4jJdbcEventLogger
java.lang.Object
org.apache.cayenne.log.Slf4jJdbcEventLogger
- All Implemented Interfaces:
JdbcEventLogger
- Direct Known Subclasses:
CompactSlf4jJdbcEventLogger
,FormattedSlf4jJdbcEventLogger
A
JdbcEventLogger
built on top of slf4j-api logger.- Since:
- 3.1, 4.0 renamed from CommonsJdbcEventLogger to Slf4jJdbcEventLogger as part of migration to SLF4J
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendParameters
(StringBuilder buffer, String label, ParameterBinding[] bindings) boolean
Returns true if current thread default log level is high enough to generate output.void
Logs an arbitrary message.void
logBeginTransaction
(String transactionLabel) void
logCommitTransaction
(String transactionLabel) void
logGeneratedKey
(DbAttribute attribute, Object value) void
logQuery
(String sql, ParameterBinding[] bindings) void
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)
-
Field Details
-
queryExecutionTimeLoggingThreshold
protected long queryExecutionTimeLoggingThreshold
-
-
Constructor Details
-
Slf4jJdbcEventLogger
-
-
Method Details
-
log
Description copied from interface:JdbcEventLogger
Logs an arbitrary message.- Specified by:
log
in interfaceJdbcEventLogger
-
logGeneratedKey
- Specified by:
logGeneratedKey
in interfaceJdbcEventLogger
-
logQuery
- Specified by:
logQuery
in interfaceJdbcEventLogger
-
logQueryParameters
- Specified by:
logQueryParameters
in interfaceJdbcEventLogger
-
appendParameters
-
logSelectCount
public void logSelectCount(int count, long time) - Specified by:
logSelectCount
in interfaceJdbcEventLogger
-
logSelectCount
- Specified by:
logSelectCount
in interfaceJdbcEventLogger
- Parameters:
count
- of selected rowstime
- (milliseconds) time query took to runsql
- SQL that was executed, printed when time exceeds timeThreshold
-
logUpdateCount
public void logUpdateCount(int count) - Specified by:
logUpdateCount
in interfaceJdbcEventLogger
-
logBeginTransaction
- Specified by:
logBeginTransaction
in interfaceJdbcEventLogger
-
logCommitTransaction
- Specified by:
logCommitTransaction
in interfaceJdbcEventLogger
-
logRollbackTransaction
- Specified by:
logRollbackTransaction
in interfaceJdbcEventLogger
-
logQueryError
- Specified by:
logQueryError
in interfaceJdbcEventLogger
-
isLoggable
public boolean isLoggable()Description copied from interface:JdbcEventLogger
Returns true if current thread default log level is high enough to generate output.- Specified by:
isLoggable
in interfaceJdbcEventLogger
-