org.skife.jdbi.v2.logging
Class Log4JLog

java.lang.Object
  extended by org.skife.jdbi.v2.logging.FormattedLog
      extended by org.skife.jdbi.v2.logging.Log4JLog
All Implemented Interfaces:
SQLLog

public final class Log4JLog
extends FormattedLog

Logs SQL via Log4J


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.skife.jdbi.v2.tweak.SQLLog
SQLLog.BatchLogger
 
Constructor Summary
Log4JLog()
          Logs to org.skife.jdbi.v2 logger at the debug level
Log4JLog(org.apache.log4j.Logger log)
          Use an arbitrary logger to log to at the debug level
Log4JLog(org.apache.log4j.Logger log, org.apache.log4j.Priority level)
          Specify both the logger and the priority to log at
 
Method Summary
protected  boolean isEnabled()
          Used to ask implementations if logging is enabled.
protected  void log(String msg)
          Log the statement passed in
 
Methods inherited from class org.skife.jdbi.v2.logging.FormattedLog
logBatch, logBeginTransaction, logCheckpointTransaction, logCommitTransaction, logObtainHandle, logPreparedBatch, logReleaseCheckpointTransaction, logReleaseHandle, logRollbackToCheckpoint, logRollbackTransaction, logSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4JLog

public Log4JLog()
Logs to org.skife.jdbi.v2 logger at the debug level


Log4JLog

public Log4JLog(org.apache.log4j.Logger log)
Use an arbitrary logger to log to at the debug level


Log4JLog

public Log4JLog(org.apache.log4j.Logger log,
                org.apache.log4j.Priority level)
Specify both the logger and the priority to log at

Parameters:
log - The logger to log to
level - the priority to log at
Method Detail

isEnabled

protected final boolean isEnabled()
Description copied from class: FormattedLog
Used to ask implementations if logging is enabled.

Specified by:
isEnabled in class FormattedLog
Returns:
true if statement logging is enabled

log

protected final void log(String msg)
Description copied from class: FormattedLog
Log the statement passed in

Specified by:
log in class FormattedLog
Parameters:
msg - the message to log


Copyright © 2011. All Rights Reserved.