Package org.apache.cayenne.log
Class Slf4jJdbcEventLogger
java.lang.Object
org.apache.cayenne.log.Slf4jJdbcEventLogger
- All Implemented Interfaces:
- JdbcEventLogger
- Direct Known Subclasses:
- CompactSlf4jJdbcEventLogger,- FormattedSlf4jJdbcEventLogger
public class Slf4jJdbcEventLogger extends Object implements JdbcEventLogger
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 SummaryFields Modifier and Type Field Description protected longqueryExecutionTimeLoggingThreshold
- 
Constructor SummaryConstructors Constructor Description Slf4jJdbcEventLogger(RuntimeProperties runtimeProperties)
- 
Method SummaryModifier and Type Method Description protected voidappendParameters(StringBuilder buffer, String label, ParameterBinding[] bindings)booleanisLoggable()Returns true if current thread default log level is high enough to generate output.voidlog(String message)Logs an arbitrary message.voidlogBeginTransaction(String transactionLabel)voidlogCommitTransaction(String transactionLabel)voidlogGeneratedKey(DbAttribute attribute, Object value)voidlogQuery(String sql, ParameterBinding[] bindings)voidlogQueryError(Throwable th)voidlogQueryParameters(String label, ParameterBinding[] bindings)voidlogRollbackTransaction(String transactionLabel)voidlogSelectCount(int count, long time)voidlogSelectCount(int count, long time, String sql)voidlogUpdateCount(int count)
- 
Field Details- 
queryExecutionTimeLoggingThresholdprotected long queryExecutionTimeLoggingThreshold
 
- 
- 
Constructor Details- 
Slf4jJdbcEventLogger
 
- 
- 
Method Details- 
logDescription copied from interface:JdbcEventLoggerLogs an arbitrary message.- Specified by:
- login interface- JdbcEventLogger
 
- 
logGeneratedKey- Specified by:
- logGeneratedKeyin interface- JdbcEventLogger
 
- 
logQuery- Specified by:
- logQueryin interface- JdbcEventLogger
 
- 
logQueryParameters- Specified by:
- logQueryParametersin interface- JdbcEventLogger
 
- 
appendParameters
- 
logSelectCountpublic void logSelectCount(int count, long time)- Specified by:
- logSelectCountin interface- JdbcEventLogger
 
- 
logSelectCount- Specified by:
- logSelectCountin interface- JdbcEventLogger
- Parameters:
- count- of selected rows
- time- (milliseconds) time query took to run
- sql- SQL that was executed, printed when time exceeds timeThreshold
 
- 
logUpdateCountpublic void logUpdateCount(int count)- Specified by:
- logUpdateCountin interface- JdbcEventLogger
 
- 
logBeginTransaction- Specified by:
- logBeginTransactionin interface- JdbcEventLogger
 
- 
logCommitTransaction- Specified by:
- logCommitTransactionin interface- JdbcEventLogger
 
- 
logRollbackTransaction- Specified by:
- logRollbackTransactionin interface- JdbcEventLogger
 
- 
logQueryError- Specified by:
- logQueryErrorin interface- JdbcEventLogger
 
- 
isLoggablepublic boolean isLoggable()Description copied from interface:JdbcEventLoggerReturns true if current thread default log level is high enough to generate output.- Specified by:
- isLoggablein interface- JdbcEventLogger
 
 
-