public abstract class AbstractSlowQueryLoggingListener extends SlowQueryListener
SlowQueryListener.RunningQueryContext| Modifier and Type | Field and Description |
|---|---|
protected String |
prefix |
protected QueryLogEntryCreator |
queryLogEntryCreator |
protected boolean |
writeConnectionId |
protected boolean |
writeDataSourceName |
protected boolean |
writeIsolation |
executor, inExecution, stopwatchFactory, threshold, thresholdTimeUnit, useDaemonThreadDEFAULT| Constructor and Description |
|---|
AbstractSlowQueryLoggingListener() |
| Modifier and Type | Method and Description |
|---|---|
QueryLogEntryCreator |
getQueryLogEntryCreator() |
protected void |
onSlowQuery(ExecutionInfo execInfo,
List<QueryInfo> queryInfoList,
long startTimeInMills)
Callback invoked when query execution exceeds the threshold.
|
void |
setQueryLogEntryCreator(QueryLogEntryCreator queryLogEntryCreator) |
void |
setWriteConnectionId(boolean writeConnectionId) |
void |
setWriteDataSourceName(boolean writeDataSourceName) |
void |
setWriteIsolation(boolean writeIsolation) |
protected abstract void |
writeLog(String message) |
afterQuery, beforeQuery, getExecutionInfoKey, getExecutor, getThreshold, getThresholdTimeUnit, setStopwatchFactory, setThreshold, setThresholdTimeUnit, setUseDaemonThreadprotected boolean writeDataSourceName
protected boolean writeConnectionId
protected boolean writeIsolation
protected QueryLogEntryCreator queryLogEntryCreator
protected String prefix
protected void onSlowQuery(ExecutionInfo execInfo, List<QueryInfo> queryInfoList, long startTimeInMills)
SlowQueryListenerThis callback is invoked only once per query if it exceeds the threshold.
It is invoked by a thread from the scheduled executor while the query is still running.
ExecutionInfo.getElapsedTime() contains the elapsed time at the moment of the check.
onSlowQuery in class SlowQueryListenerexecInfo - query execution infoqueryInfoList - query parameter infostartTimeInMills - time in milliseconds when the query startedprotected abstract void writeLog(String message)
public void setQueryLogEntryCreator(QueryLogEntryCreator queryLogEntryCreator)
public QueryLogEntryCreator getQueryLogEntryCreator()
public void setWriteDataSourceName(boolean writeDataSourceName)
public void setWriteConnectionId(boolean writeConnectionId)
public void setWriteIsolation(boolean writeIsolation)
Copyright © 2026. All rights reserved.