java.lang.Object
org.seasar.doma.jdbc.AbstractJdbcLogger<LEVEL>
- Type Parameters:
LEVEL- The log level
- All Implemented Interfaces:
JdbcLogger
- Direct Known Subclasses:
UtilLoggingJdbcLogger
A skeletal implementation of the
JdbcLogger interface.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJdbcLogger(LEVEL level) Creates an instance with a log level. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetSqlText(Sql<?> sql) protected abstract voidlog(LEVEL level, String callerClassName, String callerMethodName, Throwable throwable, Supplier<String> messageSupplier) Logs an error or an exception.voidlogAutoCommitEnablingFailure(String callerClassName, String callerMethodName, SQLException e) Logs a failure of an auto commit enabling.protected voidlogAutoCommitEnablingFailure(String callerClassName, String callerMethodName, SQLException e, LEVEL level, Supplier<String> messageSupplier) voidlogConnectionClosingFailure(String callerClassName, String callerMethodName, SQLException e) Logs a failure of a connection close.protected voidlogConnectionClosingFailure(String callerClassName, String callerMethodName, SQLException e, LEVEL level, Supplier<String> messageSupplier) voidlogDaoMethodEntering(String callerClassName, String callerMethodName, Object... args) Logs the start of a DAO method.protected voidlogDaoMethodEntering(String callerClassName, String callerMethodName, Object[] args, LEVEL level, Supplier<String> messageSupplier) voidlogDaoMethodExiting(String callerClassName, String callerMethodName, Object result) Logs the normal end of a DAO method.protected voidlogDaoMethodExiting(String callerClassName, String callerMethodName, Object result, LEVEL level, Supplier<String> messageSupplier) voidlogDaoMethodThrowing(String callerClassName, String callerMethodName, RuntimeException e) Logs the abnormal end of a DAO method.protected voidlogDaoMethodThrowing(String callerClassName, String callerMethodName, RuntimeException e, LEVEL level, Supplier<String> messageSupplier) voidlogResultSetClosingFailure(String callerClassName, String callerMethodName, SQLException e) Logs a failure of a result set close.protected voidlogResultSetClosingFailure(String callerClassName, String callerMethodName, SQLException e, LEVEL level, Supplier<String> messageSupplier) voidLogs an SQL statement.protected voidlogSql(String callerClassName, String callerMethodName, Sql<?> sql, LEVEL level, Supplier<String> messageSupplier) voidlogSqlExecutionSkipping(String callerClassName, String callerMethodName, SqlExecutionSkipCause cause) Logs a skip of an SQL execution.protected voidlogSqlExecutionSkipping(String callerClassName, String callerMethodName, SqlExecutionSkipCause cause, LEVEL level, Supplier<String> messageSupplier) voidlogStatementClosingFailure(String callerClassName, String callerMethodName, SQLException e) Logs a failure of a statement close.protected voidlogStatementClosingFailure(String callerClassName, String callerMethodName, SQLException e, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionBegun(String callerClassName, String callerMethodName, String transactionId) Logs a beginning of a transaction.protected voidlogTransactionBegun(String callerClassName, String callerMethodName, String transactionId, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionCommitted(String callerClassName, String callerMethodName, String transactionId) Logs a commit of a transaction.protected voidlogTransactionCommitted(String callerClassName, String callerMethodName, String transactionId, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionEnded(String callerClassName, String callerMethodName, String transactionId) Logs an end of a transaction.protected voidlogTransactionEnded(String callerClassName, String callerMethodName, String transactionId, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionIsolationSettingFailure(String callerClassName, String callerMethodName, int transactionIsolationLevel, SQLException e) Logs a failure of a transaction isolation setting.protected voidlogTransactionIsolationSettingFailure(String callerClassName, String callerMethodName, int transactionIsolationLevel, SQLException e, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionRollbackFailure(String callerClassName, String callerMethodName, String transactionId, SQLException e) Logs a failure of a transaction rollback.protected voidlogTransactionRollbackFailure(String callerClassName, String callerMethodName, SQLException e, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionRolledback(String callerClassName, String callerMethodName, String transactionId) Logs a rollback of a transaction.protected voidlogTransactionRolledback(String callerClassName, String callerMethodName, String transactionId, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionSavepointCreated(String callerClassName, String callerMethodName, String transactionId, String savepointName) Logs a creation of a save point.protected voidlogTransactionSavepointCreated(String callerClassName, String callerMethodName, String transactionId, String savepointName, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionSavepointReleased(String callerClassName, String callerMethodName, String transactionId, String savepointName) Logs a release of a save point.protected voidlogTransactionSavepointReleased(String callerClassName, String callerMethodName, String transactionId, String savepointName, LEVEL level, Supplier<String> messageSupplier) voidlogTransactionSavepointRolledback(String callerClassName, String callerMethodName, String transactionId, String savepointName) Logs a rollback of a save point.protected voidlogTransactionSavepointRolledback(String callerClassName, String callerMethodName, String transactionId, String savepointName, LEVEL level, Supplier<String> messageSupplier)
-
Field Details
-
defaultLevel
the default log level
-
-
Constructor Details
-
AbstractJdbcLogger
Creates an instance with a log level.- Parameters:
level- the log level
-
-
Method Details
-
log
protected abstract void log(LEVEL level, String callerClassName, String callerMethodName, Throwable throwable, Supplier<String> messageSupplier) Logs an error or an exception.- Parameters:
level- the log levelcallerClassName- the caller class namecallerMethodName- the caller method namethrowable- the error or exceptionmessageSupplier- the message supplier
-
logDaoMethodEntering
Description copied from interface:JdbcLoggerLogs the start of a DAO method.- Specified by:
logDaoMethodEnteringin interfaceJdbcLogger- Parameters:
callerClassName- the name of the DAO classcallerMethodName- the name of the DAO methodargs- the arguments of the DAO method
-
logDaoMethodEntering
-
logDaoMethodExiting
Description copied from interface:JdbcLoggerLogs the normal end of a DAO method.At the end of the DAO method, either this method or
JdbcLogger.logDaoMethodThrowing(String, String, RuntimeException)must be invoked.- Specified by:
logDaoMethodExitingin interfaceJdbcLogger- Parameters:
callerClassName- the name of the DAO classcallerMethodName- the name of the DAO methodresult- the method result or null if the method return type isvoid
-
logDaoMethodExiting
-
logDaoMethodThrowing
public void logDaoMethodThrowing(String callerClassName, String callerMethodName, RuntimeException e) Description copied from interface:JdbcLoggerLogs the abnormal end of a DAO method.At the end of the DAO method, either this method or
JdbcLogger.logDaoMethodExiting(String, String, Object)must be invoked.- Specified by:
logDaoMethodThrowingin interfaceJdbcLogger- Parameters:
callerClassName- the name of the DAO classcallerMethodName- the name of the DAO methode- the runtime exception
-
logDaoMethodThrowing
-
logSqlExecutionSkipping
public void logSqlExecutionSkipping(String callerClassName, String callerMethodName, SqlExecutionSkipCause cause) Description copied from interface:JdbcLoggerLogs a skip of an SQL execution.- Specified by:
logSqlExecutionSkippingin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method namecause- the cause of the skip
-
logSqlExecutionSkipping
-
logSql
Description copied from interface:JdbcLoggerLogs an SQL statement.- Specified by:
logSqlin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method namesql- SQL
-
logSql
-
getSqlText
-
logTransactionBegun
public void logTransactionBegun(String callerClassName, String callerMethodName, String transactionId) Description copied from interface:JdbcLoggerLogs a beginning of a transaction.- Specified by:
logTransactionBegunin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction id
-
logTransactionBegun
-
logTransactionEnded
public void logTransactionEnded(String callerClassName, String callerMethodName, String transactionId) Description copied from interface:JdbcLoggerLogs an end of a transaction.- Specified by:
logTransactionEndedin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction id
-
logTransactionEnded
-
logTransactionSavepointCreated
public void logTransactionSavepointCreated(String callerClassName, String callerMethodName, String transactionId, String savepointName) Description copied from interface:JdbcLoggerLogs a creation of a save point.- Specified by:
logTransactionSavepointCreatedin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction idsavepointName- the save point name
-
logTransactionSavepointCreated
-
logTransactionCommitted
public void logTransactionCommitted(String callerClassName, String callerMethodName, String transactionId) Description copied from interface:JdbcLoggerLogs a commit of a transaction.- Specified by:
logTransactionCommittedin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction id
-
logTransactionCommitted
-
logTransactionRolledback
public void logTransactionRolledback(String callerClassName, String callerMethodName, String transactionId) Description copied from interface:JdbcLoggerLogs a rollback of a transaction.- Specified by:
logTransactionRolledbackin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction id
-
logTransactionRolledback
-
logTransactionSavepointRolledback
public void logTransactionSavepointRolledback(String callerClassName, String callerMethodName, String transactionId, String savepointName) Description copied from interface:JdbcLoggerLogs a rollback of a save point.- Specified by:
logTransactionSavepointRolledbackin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction idsavepointName- the save point name
-
logTransactionSavepointRolledback
-
logTransactionSavepointReleased
public void logTransactionSavepointReleased(String callerClassName, String callerMethodName, String transactionId, String savepointName) Description copied from interface:JdbcLoggerLogs a release of a save point.- Specified by:
logTransactionSavepointReleasedin interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction idsavepointName- the save point name
-
logTransactionSavepointReleased
-
logTransactionRollbackFailure
public void logTransactionRollbackFailure(String callerClassName, String callerMethodName, String transactionId, SQLException e) Description copied from interface:JdbcLoggerLogs a failure of a transaction rollback.- Specified by:
logTransactionRollbackFailurein interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionId- the transaction ide- the cause of the failure
-
logTransactionRollbackFailure
-
logAutoCommitEnablingFailure
public void logAutoCommitEnablingFailure(String callerClassName, String callerMethodName, SQLException e) Description copied from interface:JdbcLoggerLogs a failure of an auto commit enabling.- Specified by:
logAutoCommitEnablingFailurein interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method namee- the cause of the failure- See Also:
-
logAutoCommitEnablingFailure
-
logTransactionIsolationSettingFailure
public void logTransactionIsolationSettingFailure(String callerClassName, String callerMethodName, int transactionIsolationLevel, SQLException e) Description copied from interface:JdbcLoggerLogs a failure of a transaction isolation setting.- Specified by:
logTransactionIsolationSettingFailurein interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method nametransactionIsolationLevel- the transaction isolation levele- the cause of the failure- See Also:
-
logTransactionIsolationSettingFailure
-
logConnectionClosingFailure
public void logConnectionClosingFailure(String callerClassName, String callerMethodName, SQLException e) Description copied from interface:JdbcLoggerLogs a failure of a connection close.- Specified by:
logConnectionClosingFailurein interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method namee- the cause of the failure- See Also:
-
logConnectionClosingFailure
-
logStatementClosingFailure
public void logStatementClosingFailure(String callerClassName, String callerMethodName, SQLException e) Description copied from interface:JdbcLoggerLogs a failure of a statement close.- Specified by:
logStatementClosingFailurein interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method namee- the cause of the failure- See Also:
-
logStatementClosingFailure
-
logResultSetClosingFailure
public void logResultSetClosingFailure(String callerClassName, String callerMethodName, SQLException e) Description copied from interface:JdbcLoggerLogs a failure of a result set close.- Specified by:
logResultSetClosingFailurein interfaceJdbcLogger- Parameters:
callerClassName- the caller class namecallerMethodName- the caller method namee- the cause of the failure- See Also:
-
logResultSetClosingFailure
-