public class SqlStatementLogger extends Object
| Constructor and Description |
|---|
SqlStatementLogger()
Constructs a new SqlStatementLogger instance.
|
SqlStatementLogger(boolean logToStdout,
boolean format)
Constructs a new SqlStatementLogger instance.
|
SqlStatementLogger(boolean logToStdout,
boolean format,
boolean highlight)
Constructs a new SqlStatementLogger instance.
|
SqlStatementLogger(boolean logToStdout,
boolean format,
boolean highlight,
long logSlowQuery)
Constructs a new SqlStatementLogger instance.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLogSlowQuery() |
boolean |
isFormat() |
boolean |
isLogToStdout()
Are we currently logging to stdout?
|
void |
logSlowQuery(Statement statement,
long startTimeNanos)
Log a slow SQL query
|
void |
logSlowQuery(String sql,
long startTimeNanos)
Log a slow SQL query
|
void |
logStatement(String statement)
Log a SQL statement string.
|
void |
logStatement(String statement,
org.hibernate.engine.jdbc.internal.Formatter formatter)
Log a SQL statement string using the specified formatter
|
void |
setFormat(boolean format)
Deprecated.
Will likely be removed:
Should either become immutable or threadsafe.
|
void |
setLogToStdout(boolean logToStdout)
Deprecated.
Will likely be removed:
Should either become immutable or threadsafe.
|
public SqlStatementLogger()
public SqlStatementLogger(boolean logToStdout,
boolean format)
logToStdout - Should we log to STDOUT in addition to our internal logger.format - Should we format the statements in the console and logpublic SqlStatementLogger(boolean logToStdout,
boolean format,
boolean highlight)
logToStdout - Should we log to STDOUT in addition to our internal logger.format - Should we format the statements in the console and loghighlight - Should we highlight the statements in the consolepublic SqlStatementLogger(boolean logToStdout,
boolean format,
boolean highlight,
long logSlowQuery)
logToStdout - Should we log to STDOUT in addition to our internal logger.format - Should we format the statements in the console and loghighlight - Should we highlight the statements in the consolelogSlowQuery - Should we logs query which executed slower than specified milliseconds. 0 - disabled.public boolean isLogToStdout()
@Deprecated public void setLogToStdout(boolean logToStdout)
logToStdout - True to enable logging to stdout; false to disable.public boolean isFormat()
@Deprecated public void setFormat(boolean format)
public long getLogSlowQuery()
public void logStatement(String statement)
statement - The SQL statement.public void logStatement(String statement, org.hibernate.engine.jdbc.internal.Formatter formatter)
statement - The SQL statement.formatter - The formatter to use.public void logSlowQuery(Statement statement, long startTimeNanos)
statement - SQL statement.startTimeNanos - Start time in nanoseconds.public void logSlowQuery(String sql, long startTimeNanos)
sql - The SQL query.startTimeNanos - Start time in nanoseconds.Copyright © 2001-2022 Red Hat, Inc. All Rights Reserved.