public class LoggingEventListener extends SimpleJdbcEventListener
To use a custom implementation for logging, extend this class and add the fully qualified class name of your
implementation to src/main/resources/META-INF/services/com.p6spy.engine.logging.LoggingEventListener.
| Modifier and Type | Field and Description |
|---|---|
static LoggingEventListener |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
protected |
LoggingEventListener() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
logElapsed(Loggable loggable,
long timeElapsedNanos,
Category category,
java.sql.SQLException e) |
void |
onAfterAnyAddBatch(StatementInformation statementInformation,
long timeElapsedNanos,
java.sql.SQLException e)
This callback method is executed before any
Statement.addBatch* method is invoked |
void |
onAfterAnyExecute(StatementInformation statementInformation,
long timeElapsedNanos,
java.sql.SQLException e)
This callback method is executed after any
Statement.execute* method is invoked |
void |
onAfterCommit(ConnectionInformation connectionInformation,
long timeElapsedNanos,
java.sql.SQLException e)
This callback method is executed after the
Connection.commit() method is invoked. |
void |
onAfterExecuteBatch(StatementInformation statementInformation,
long timeElapsedNanos,
int[] updateCounts,
java.sql.SQLException e)
This callback method is executed after the
Statement.executeBatch() method is invoked. |
void |
onAfterGetResultSet(StatementInformation statementInformation,
long timeElapsedNanos,
java.sql.SQLException e)
This callback method is executed after the
Statement.getResultSet() method is invoked. |
void |
onAfterResultSetClose(ResultSetInformation resultSetInformation,
java.sql.SQLException e)
This callback method is executed after the
ResultSet.close() method is invoked. |
void |
onAfterResultSetGet(ResultSetInformation resultSetInformation,
int columnIndex,
java.lang.Object value,
java.sql.SQLException e)
This callback method is executed after any of the
ResultSet#get*(int) methods are invoked. |
void |
onAfterResultSetGet(ResultSetInformation resultSetInformation,
java.lang.String columnLabel,
java.lang.Object value,
java.sql.SQLException e)
This callback method is executed after any of the
ResultSet#get*(String) methods are invoked. |
void |
onAfterResultSetNext(ResultSetInformation resultSetInformation,
long timeElapsedNanos,
boolean hasNext,
java.sql.SQLException e)
This callback method is executed after the
ResultSet.next() method is invoked. |
void |
onAfterRollback(ConnectionInformation connectionInformation,
long timeElapsedNanos,
java.sql.SQLException e)
This callback method is executed after the
Connection.rollback() or the Connection.rollback(Savepoint) method is invoked. |
void |
onBeforeResultSetNext(ResultSetInformation resultSetInformation)
This callback method is executed before the
ResultSet.next() method is invoked. |
onAfterAddBatch, onAfterAddBatch, onAfterExecute, onAfterExecute, onAfterExecuteQuery, onAfterExecuteQuery, onAfterExecuteUpdate, onAfterExecuteUpdate, onBeforeAddBatch, onBeforeAddBatch, onBeforeAnyAddBatch, onBeforeAnyExecute, onBeforeExecute, onBeforeExecute, onBeforeExecuteBatch, onBeforeExecuteQuery, onBeforeExecuteQuery, onBeforeExecuteUpdate, onBeforeExecuteUpdateonAfterCallableStatementSet, onAfterConnectionClose, onAfterGetConnection, onAfterPreparedStatementSet, onAfterSetAutoCommit, onAfterStatementClose, onBeforeCommit, onBeforeGetConnection, onBeforeRollback, onBeforeSetAutoCommit, onConnectionWrappedpublic static final LoggingEventListener INSTANCE
public void onAfterAnyExecute(StatementInformation statementInformation, long timeElapsedNanos, java.sql.SQLException e)
SimpleJdbcEventListenerStatement.execute* method is invokedonAfterAnyExecute in class SimpleJdbcEventListenerstatementInformation - The meta information about the Statement being invokedtimeElapsedNanos - The execution time of the execute calle - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterExecuteBatch(StatementInformation statementInformation, long timeElapsedNanos, int[] updateCounts, java.sql.SQLException e)
JdbcEventListenerStatement.executeBatch() method is invoked.onAfterExecuteBatch in class SimpleJdbcEventListenerstatementInformation - The meta information about the Statement being invokedtimeElapsedNanos - The execution time of the execute callupdateCounts - An array of update counts or null if an exception was throwne - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterCommit(ConnectionInformation connectionInformation, long timeElapsedNanos, java.sql.SQLException e)
JdbcEventListenerConnection.commit() method is invoked.onAfterCommit in class JdbcEventListenerconnectionInformation - The meta information about the Connection being invokedtimeElapsedNanos - The execution time of the execute calle - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterRollback(ConnectionInformation connectionInformation, long timeElapsedNanos, java.sql.SQLException e)
JdbcEventListenerConnection.rollback() or the Connection.rollback(Savepoint) method is invoked.onAfterRollback in class JdbcEventListenerconnectionInformation - The meta information about the Connection being invokedtimeElapsedNanos - The execution time of the execute calle - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterAnyAddBatch(StatementInformation statementInformation, long timeElapsedNanos, java.sql.SQLException e)
SimpleJdbcEventListenerStatement.addBatch* method is invokedonAfterAnyAddBatch in class SimpleJdbcEventListenerstatementInformation - The meta information about the Statement being invokedtimeElapsedNanos - The execution time of the execute calle - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterGetResultSet(StatementInformation statementInformation, long timeElapsedNanos, java.sql.SQLException e)
JdbcEventListenerStatement.getResultSet() method is invoked.onAfterGetResultSet in class JdbcEventListenerstatementInformation - The meta information about the Statement being invokedtimeElapsedNanos - The execution time of the execute calle - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterResultSetGet(ResultSetInformation resultSetInformation, int columnIndex, java.lang.Object value, java.sql.SQLException e)
JdbcEventListenerResultSet#get*(int) methods are invoked.onAfterResultSetGet in class JdbcEventListenerresultSetInformation - The meta information about the ResultSet being invokedcolumnIndex - the first column is 1, the second is 2, ...value - the column value; if the value is SQL NULL, the value returned is nulle - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterResultSetGet(ResultSetInformation resultSetInformation, java.lang.String columnLabel, java.lang.Object value, java.sql.SQLException e)
JdbcEventListenerResultSet#get*(String) methods are invoked.onAfterResultSetGet in class JdbcEventListenerresultSetInformation - The meta information about the ResultSet being invokedcolumnLabel - The label for the column specified with the SQL AS clause. If the SQL AS clause was
not specified, then the label is the name of the columnvalue - The column value; if the value is SQL NULL, the value returned is nulle - The SQLException which may be triggered by the call (null if
there was no exception).public void onBeforeResultSetNext(ResultSetInformation resultSetInformation)
JdbcEventListenerResultSet.next() method is invoked.onBeforeResultSetNext in class JdbcEventListenerresultSetInformation - The meta information about the ResultSet being invokedpublic void onAfterResultSetNext(ResultSetInformation resultSetInformation, long timeElapsedNanos, boolean hasNext, java.sql.SQLException e)
JdbcEventListenerResultSet.next() method is invoked.onAfterResultSetNext in class JdbcEventListenerresultSetInformation - The meta information about the ResultSet being invokedtimeElapsedNanos - The execution time of the execute callhasNext - The return value of ResultSet.next()e - The SQLException which may be triggered by the call (null if
there was no exception).public void onAfterResultSetClose(ResultSetInformation resultSetInformation, java.sql.SQLException e)
JdbcEventListenerResultSet.close() method is invoked.onAfterResultSetClose in class JdbcEventListenerresultSetInformation - The meta information about the ResultSet being invokede - The SQLException which may be triggered by the call (null if
there was no exception).