org.hibernate.jdbc.util
Class SQLStatementLogger

java.lang.Object
  extended by org.hibernate.jdbc.util.SQLStatementLogger

public class SQLStatementLogger
extends Object

Centralize logging handling for SQL statements.

Author:
Steve Ebersole

Constructor Summary
SQLStatementLogger()
          Constructs a new SQLStatementLogger instance.
SQLStatementLogger(boolean logToStdout, boolean formatSql)
          Constructs a new SQLStatementLogger instance.
 
Method Summary
 boolean isFormatSql()
          Getter for property 'formatSql'.
 boolean isLogToStdout()
          Getter for property 'logToStdout'.
 void logStatement(String statement, FormatStyle style)
          Log a SQL statement string.
 void setFormatSql(boolean formatSql)
          Setter for property 'formatSql'.
 void setLogToStdout(boolean logToStdout)
          Setter for property 'logToStdout'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStatementLogger

public SQLStatementLogger()
Constructs a new SQLStatementLogger instance.


SQLStatementLogger

public SQLStatementLogger(boolean logToStdout,
                          boolean formatSql)
Constructs a new SQLStatementLogger instance.

Parameters:
logToStdout - Should we log to STDOUT in addition to our internal logger.
formatSql - Should we format SQL ('prettify') prior to logging.
Method Detail

isLogToStdout

public boolean isLogToStdout()
Getter for property 'logToStdout'.

Returns:
Value for property 'logToStdout'.
See Also:
setLogToStdout(boolean)

setLogToStdout

public void setLogToStdout(boolean logToStdout)
Setter for property 'logToStdout'.

Parameters:
logToStdout - Value to set for property 'logToStdout'.

isFormatSql

public boolean isFormatSql()
Getter for property 'formatSql'.

Returns:
Value for property 'formatSql'.
See Also:
setFormatSql(boolean)

setFormatSql

public void setFormatSql(boolean formatSql)
Setter for property 'formatSql'.

Parameters:
formatSql - Value to set for property 'formatSql'.

logStatement

public void logStatement(String statement,
                         FormatStyle style)
Log a SQL statement string.

Parameters:
statement - The SQL statement.
style - The requested formatting style.


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.