public class Slf4jJdbcEventLogger extends Object implements JdbcEventLogger
JdbcEventLogger
built on top of slf4j-api logger.Modifier and Type | Field and Description |
---|---|
protected long |
queryExecutionTimeLoggingThreshold |
Constructor and Description |
---|
Slf4jJdbcEventLogger(RuntimeProperties runtimeProperties) |
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.
|
void |
logConnect(String url,
String userName,
String password)
Deprecated.
|
void |
logConnectFailure(Throwable th)
Deprecated.
|
void |
logConnectSuccess()
Deprecated.
|
void |
logGeneratedKey(DbAttribute attribute,
Object value) |
void |
logPoolCreated(DataSourceInfo dsi)
Deprecated.
|
void |
logQuery(String queryStr,
List<?> params)
Deprecated.
since 4.0 use
#logQuery(String, ParameterBinding[], long) . |
void |
logQuery(String queryStr,
List<DbAttribute> attrs,
List<?> params,
long time)
Deprecated.
|
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
|
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) |
public Slf4jJdbcEventLogger(RuntimeProperties runtimeProperties)
public void log(String message)
JdbcEventLogger
log
in interface JdbcEventLogger
@Deprecated public void logConnect(String dataSource)
JdbcEventLogger
logConnect
in interface JdbcEventLogger
@Deprecated public void logConnect(String url, String userName, String password)
logConnect
in interface JdbcEventLogger
@Deprecated public void logPoolCreated(DataSourceInfo dsi)
logPoolCreated
in interface JdbcEventLogger
@Deprecated public void logConnectSuccess()
logConnectSuccess
in interface JdbcEventLogger
@Deprecated public void logConnectFailure(Throwable th)
logConnectFailure
in interface JdbcEventLogger
public void logGeneratedKey(DbAttribute attribute, Object value)
logGeneratedKey
in interface JdbcEventLogger
@Deprecated public void logQuery(String queryStr, List<?> params)
#logQuery(String, ParameterBinding[], long)
.logQuery
in interface JdbcEventLogger
public void logQuery(String sql, ParameterBinding[] bindings)
logQuery
in interface JdbcEventLogger
@Deprecated public void logQuery(String queryStr, List<DbAttribute> attrs, List<?> params, long time)
logQuery
in interface JdbcEventLogger
@Deprecated public void logQueryParameters(String label, List<DbAttribute> attrs, List<Object> parameters, boolean isInserting)
logQueryParameters
in interface JdbcEventLogger
public void logQueryParameters(String label, ParameterBinding[] bindings)
logQueryParameters
in interface JdbcEventLogger
public void logSelectCount(int count, long time)
logSelectCount
in interface JdbcEventLogger
public void logSelectCount(int count, long time, String sql)
logSelectCount
in interface JdbcEventLogger
count
- of selected rowstime
- (milliseconds) time query took to runsql
- SQL that was executed, printed when time exceeds timeThresholdpublic void logUpdateCount(int count)
logUpdateCount
in interface JdbcEventLogger
public void logBeginTransaction(String transactionLabel)
logBeginTransaction
in interface JdbcEventLogger
public void logCommitTransaction(String transactionLabel)
logCommitTransaction
in interface JdbcEventLogger
public void logRollbackTransaction(String transactionLabel)
logRollbackTransaction
in interface JdbcEventLogger
public void logQueryError(Throwable th)
logQueryError
in interface JdbcEventLogger
public boolean isLoggable()
JdbcEventLogger
isLoggable
in interface JdbcEventLogger
Copyright © 2001–2019 Apache Cayenne. All rights reserved.