LEVEL - The log levelpublic abstract class AbstractJdbcLogger<LEVEL> extends java.lang.Object implements JdbcLogger
JdbcLogger interface.| Modifier and Type | Field and Description |
|---|---|
protected LEVEL |
defaultLevel
the default log level
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJdbcLogger(LEVEL level)
Creates an instance with a log level.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getSqlText(Sql<?> sql) |
protected abstract void |
log(LEVEL level,
java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Throwable throwable,
java.util.function.Supplier<java.lang.String> messageSupplier)
Logs an error or an exception.
|
void |
logAutoCommitEnablingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
Logs a failure of an auto commit enabling.
|
protected void |
logAutoCommitEnablingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logConnectionClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
Logs a failure of a connection close.
|
protected void |
logConnectionClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logDaoMethodEntering(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object... args)
Logs the start of a DAO method.
|
protected void |
logDaoMethodEntering(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object[] args,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logDaoMethodExiting(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object result)
Logs the normal end of a DAO method.
|
protected void |
logDaoMethodExiting(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object result,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logDaoMethodThrowing(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.RuntimeException e)
Logs the abnormal end of a DAO method.
|
protected void |
logDaoMethodThrowing(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.RuntimeException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logResultSetClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
Logs a failure of a result set close.
|
protected void |
logResultSetClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logSql(java.lang.String callerClassName,
java.lang.String callerMethodName,
Sql<?> sql)
Logs an SQL statement.
|
protected void |
logSql(java.lang.String callerClassName,
java.lang.String callerMethodName,
Sql<?> sql,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logSqlExecutionSkipping(java.lang.String callerClassName,
java.lang.String callerMethodName,
SqlExecutionSkipCause cause)
Logs a skip of an SQL execution.
|
protected void |
logSqlExecutionSkipping(java.lang.String callerClassName,
java.lang.String callerMethodName,
SqlExecutionSkipCause cause,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logStatementClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
Logs a failure of a statement close.
|
protected void |
logStatementClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionBegun(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
Logs a beginning of a transaction.
|
protected void |
logTransactionBegun(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionCommitted(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
Logs a commit of a transaction.
|
protected void |
logTransactionCommitted(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionEnded(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
Logs an end of a transaction.
|
protected void |
logTransactionEnded(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionIsolationSettingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
int transactionIsolationLevel,
java.sql.SQLException e)
Logs a failure of a transaction isolation setting.
|
protected void |
logTransactionIsolationSettingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
int transactionIsolationLevel,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
protected void |
logTransactionRollbackFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionRollbackFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.sql.SQLException e)
Logs a failure of a transaction rollback.
|
void |
logTransactionRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
Logs a rollback of a transaction.
|
protected void |
logTransactionRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionSavepointCreated(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName)
Logs a creation of a save point.
|
protected void |
logTransactionSavepointCreated(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionSavepointReleased(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName)
Logs a release of a save point.
|
protected void |
logTransactionSavepointReleased(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
void |
logTransactionSavepointRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName)
Logs a rollback of a save point.
|
protected void |
logTransactionSavepointRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier) |
protected LEVEL defaultLevel
protected AbstractJdbcLogger(LEVEL level)
level - the log levelprotected abstract void log(LEVEL level, java.lang.String callerClassName, java.lang.String callerMethodName, java.lang.Throwable throwable, java.util.function.Supplier<java.lang.String> messageSupplier)
level - the log levelcallerClassName - the caller class namecallerMethodName - the caller method namethrowable - the error or exceptionmessageSupplier - the message supplierpublic void logDaoMethodEntering(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object... args)
JdbcLoggerlogDaoMethodEntering in interface JdbcLoggercallerClassName - the name of the DAO classcallerMethodName - the name of the DAO methodargs - the arguments of the DAO methodprotected void logDaoMethodEntering(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object[] args,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logDaoMethodExiting(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object result)
JdbcLoggerAt the end of the DAO method, either this method or JdbcLogger.logDaoMethodThrowing(String,
String, RuntimeException) must be invoked.
logDaoMethodExiting in interface JdbcLoggercallerClassName - the name of the DAO classcallerMethodName - the name of the DAO methodresult - the method result or null if the method return type is voidprotected void logDaoMethodExiting(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.Object result,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logDaoMethodThrowing(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.RuntimeException e)
JdbcLoggerAt the end of the DAO method, either this method or JdbcLogger.logDaoMethodExiting(String,
String, Object) must be invoked.
logDaoMethodThrowing in interface JdbcLoggercallerClassName - the name of the DAO classcallerMethodName - the name of the DAO methode - the runtime exceptionprotected void logDaoMethodThrowing(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.RuntimeException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logSqlExecutionSkipping(java.lang.String callerClassName,
java.lang.String callerMethodName,
SqlExecutionSkipCause cause)
JdbcLoggerlogSqlExecutionSkipping in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method namecause - the cause of the skipprotected void logSqlExecutionSkipping(java.lang.String callerClassName,
java.lang.String callerMethodName,
SqlExecutionSkipCause cause,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logSql(java.lang.String callerClassName,
java.lang.String callerMethodName,
Sql<?> sql)
JdbcLoggerlogSql in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method namesql - SQLprotected void logSql(java.lang.String callerClassName,
java.lang.String callerMethodName,
Sql<?> sql,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
protected java.lang.String getSqlText(Sql<?> sql)
public void logTransactionBegun(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
JdbcLoggerlogTransactionBegun in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idprotected void logTransactionBegun(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionEnded(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
JdbcLoggerlogTransactionEnded in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idprotected void logTransactionEnded(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionSavepointCreated(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName)
JdbcLoggerlogTransactionSavepointCreated in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idsavepointName - the save point nameprotected void logTransactionSavepointCreated(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionCommitted(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
JdbcLoggerlogTransactionCommitted in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idprotected void logTransactionCommitted(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId)
JdbcLoggerlogTransactionRolledback in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idprotected void logTransactionRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionSavepointRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName)
JdbcLoggerlogTransactionSavepointRolledback in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idsavepointName - the save point nameprotected void logTransactionSavepointRolledback(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionSavepointReleased(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName)
JdbcLoggerlogTransactionSavepointReleased in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction idsavepointName - the save point nameprotected void logTransactionSavepointReleased(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.lang.String savepointName,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionRollbackFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.lang.String transactionId,
java.sql.SQLException e)
JdbcLoggerlogTransactionRollbackFailure in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionId - the transaction ide - the cause of the failureprotected void logTransactionRollbackFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logAutoCommitEnablingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
JdbcLoggerlogAutoCommitEnablingFailure in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method namee - the cause of the failureConnection.setAutoCommit(boolean)protected void logAutoCommitEnablingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logTransactionIsolationSettingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
int transactionIsolationLevel,
java.sql.SQLException e)
JdbcLoggerlogTransactionIsolationSettingFailure in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method nametransactionIsolationLevel - the transaction isolation levele - the cause of the failureConnection.setTransactionIsolation(int)protected void logTransactionIsolationSettingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
int transactionIsolationLevel,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logConnectionClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
JdbcLoggerlogConnectionClosingFailure in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method namee - the cause of the failureConnection.close()protected void logConnectionClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logStatementClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
JdbcLoggerlogStatementClosingFailure in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method namee - the cause of the failureStatement.close()protected void logStatementClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)
public void logResultSetClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e)
JdbcLoggerlogResultSetClosingFailure in interface JdbcLoggercallerClassName - the caller class namecallerMethodName - the caller method namee - the cause of the failureResultSet.close()protected void logResultSetClosingFailure(java.lang.String callerClassName,
java.lang.String callerMethodName,
java.sql.SQLException e,
LEVEL level,
java.util.function.Supplier<java.lang.String> messageSupplier)