## org.hibernate.engine.jdbc.spi
Class SqlStatementLogger

    java.lang.Object
      org.hibernate.engine.jdbc.spi.SqlStatementLogger

    public class SqlStatementLogger

extends Object

Centralize logging for SQL statements.

Constructor Summary
`SqlStatementLogger()` Constructs a new SqlStatementLogger instance.
`SqlStatementLogger(boolean logToStdout, boolean format)` Constructs a new SqlStatementLogger instance.

Method Summary
`boolean` `isFormat()`
`boolean` `isLogToStdout()` Are we currently logging to stdout?
`void` `logStatement(String statement)` Log a SQL statement string.
`void` `logStatement(String statement, Formatter formatter)`
`void` `setFormat(boolean format)`
`void` `setLogToStdout(boolean logToStdout)` Enable (true) or disable (false) logging to stdout.

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 format)

  Constructs a new SqlStatementLogger instance.

  Parameters:
    `logToStdout` - Should we log to STDOUT in addition to our internal logger.
    `format` - Should we format the statements prior to logging

Method Detail

### isLogToStdout

    public boolean isLogToStdout()

  Are we currently logging to stdout?

  Returns:
    True if we are currently logging to stdout; false otherwise.

### setLogToStdout

    public void setLogToStdout(boolean logToStdout)

  Enable (true) or disable (false) logging to stdout.

  Parameters:
    `logToStdout` - True to enable logging to stdout; false to disable.

### isFormat

    public boolean isFormat()

### setFormat

    public void setFormat(boolean format)

### logStatement

    public void logStatement(String statement)

  Log a SQL statement string.

  Parameters:
    `statement` - The SQL statement.

### logStatement

    public void logStatement(String statement,
                             Formatter formatter)

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