Package org.soulwing.jdbc.logger
Class JclJdbcLogger
- java.lang.Object
-
- org.soulwing.jdbc.logger.JclJdbcLogger
-
- All Implemented Interfaces:
JdbcLogger
public class JclJdbcLogger extends Object implements JdbcLogger
AJdbcLoggerthat delegates to a Commons Logging logger.In order to use this class, commons-logging must be on your class path.
SQL statements are logged at the
debuglevel. Bound parameter values are logged at thetracelevel.- Author:
- Carl Harris
-
-
Constructor Summary
Constructors Constructor Description JclJdbcLogger(org.apache.commons.logging.Log logger)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwriteParameters(Parameter[] parameters)Writes the parameters that will be bound for an SQL statement.voidwriteStatement(String sql)Writes the text of an SQL statement to the log.
-
-
-
Method Detail
-
writeStatement
public void writeStatement(String sql)
Description copied from interface:JdbcLoggerWrites the text of an SQL statement to the log.- Specified by:
writeStatementin interfaceJdbcLogger- Parameters:
sql- the SQL statement text to write
-
writeParameters
public void writeParameters(Parameter[] parameters)
Description copied from interface:JdbcLoggerWrites the parameters that will be bound for an SQL statement.This method is invoked immediately after
JdbcLogger.writeStatement(String)to log the actual parameter values that will be used to replace statement placeholders.An implementation should check the configuration of the underlying log system as to whether this level of detail is enabled.
- Specified by:
writeParametersin interfaceJdbcLogger- Parameters:
parameters- values that will be bound before statement execution
-
-