mirror of
https://github.com/encounter/log4jdbc.git
synced 2026-03-30 11:27:21 -07:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 93d265316f | |||
| 2ab2d0389e | |||
| f4f264f921 | |||
| 3604fe043c | |||
| 6a9b4e1948 | |||
| bff4f67db8 | |||
| dc6edbdb86 | |||
| f637d041cc | |||
| 7d51cd3d3f | |||
| 77507faf9c | |||
| 8918e4a39a | |||
| d308e26494 | |||
| 053afdbf0f | |||
| d3c58ab5cd | |||
| 35b5548e2f | |||
| ab522b45e2 | |||
| 1f47f9a899 | |||
| f7a51cd827 | |||
| e261132179 |
@@ -0,0 +1,8 @@
|
||||
# log4jdbc
|
||||
A more extensive README will be created soon. For now, you can view the usage instructions at the old Google Code hosting site:
|
||||
|
||||
https://code.google.com/p/log4jdbc/
|
||||
|
||||
You can download the prebuilt jars at:
|
||||
|
||||
https://code.google.com/p/log4jdbc/downloads/list
|
||||
+28
-12
@@ -1,3 +1,19 @@
|
||||
2015-09-30 1.3 release
|
||||
|
||||
o add new option, "log4jdbc.trim.sql.lines" which when set,
|
||||
will trim SQL line by line (for beginning of line, only trimming
|
||||
consistent white space) If this option is selected, the TrimSql
|
||||
option will be ignored.
|
||||
|
||||
o remove JDBC 3 version (not all scripts updated yet.)
|
||||
|
||||
o getArray method improperly labeled as getURL (Issue 61.)
|
||||
|
||||
o bug fix ResultSetSpy.getStatement should return wrapped Statement,
|
||||
not real Statement (Issue 55.)
|
||||
|
||||
o move to GitHub (Google Code shutting down.)
|
||||
|
||||
2012-02-17 1.2 Release
|
||||
|
||||
o escape single quotes in PreparedStatement/CallableStatement bind variables (Issue 36.)
|
||||
@@ -12,51 +28,51 @@
|
||||
o add new option, log4jdbc.trim.sql.extrablanklines for removing
|
||||
extra blank lines from sql output.
|
||||
|
||||
o fix issue where extra connection was being created when
|
||||
o fix issue where extra connection was being created when
|
||||
ResultSet.getStatement was being called (Issue 33.)
|
||||
|
||||
o performance enhancement when logging not enabled (Issue 29.)
|
||||
|
||||
2010-06-09 1.2 beta 2 Release
|
||||
|
||||
o add new option, log4jdbc.auto.load.popular.drivers for
|
||||
o add new option, log4jdbc.auto.load.popular.drivers for
|
||||
disabling auto-loading of drivers
|
||||
|
||||
o look first for log4jdbc property settings in optional
|
||||
o look first for log4jdbc property settings in optional
|
||||
log4jdbc.properties file in the classpath.
|
||||
|
||||
|
||||
o Fix non-threadsafe usage of SimpleDateFormat (Issue 18)
|
||||
|
||||
o add new option, log4jdbc.trim.sql to trim the SQL before logging
|
||||
it.
|
||||
|
||||
o add new option, log4jdbc.suppress.generated.keys.exception that
|
||||
will ignore any exception produced by the method,
|
||||
will ignore any exception produced by the method,
|
||||
Statement.getGeneratedKeys(). This flag is useful in Coldfusion
|
||||
environments which typically call this method after every update,
|
||||
even if unwarranted, and ignoring the exception, thus clogging up
|
||||
even if unwarranted, and ignoring the exception, thus clogging up
|
||||
the logs with these exception reports.
|
||||
|
||||
o add support for the newer oracle.jdbc.OracleDriver driver (the
|
||||
older oracle.jdbc.driver.OracleDriver driver is still supported
|
||||
as well) and add corrected date formatting for Oracle.
|
||||
|
||||
|
||||
o fix possible null pointer issue with setBlob and setClob (Issue 21)
|
||||
|
||||
2010-03-20 1.2 beta 1 Release
|
||||
|
||||
o Check for exception that should not, but in some cases could
|
||||
o Check for exception that should not, but in some cases could
|
||||
occur when trying to format parameter arguments.
|
||||
|
||||
o Use only one type of date format so that time portion of Date
|
||||
types is not dropped!
|
||||
|
||||
o use to_date function for Oracle (Issue 14)
|
||||
|
||||
|
||||
o performance improvements
|
||||
|
||||
o fix: respect DumpSqlMaxLineLength option.
|
||||
|
||||
|
||||
o fix: respect DumpSqlMaxLineLength option.
|
||||
|
||||
o various other fixes (including Issues 8 and 9)
|
||||
|
||||
2009-02-26 1.2 alpha 2 Release
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.googlecode.log4jdbc</groupId>
|
||||
<artifactId>log4jdbc</artifactId>
|
||||
<version>1.3-SNAPSHOT</version>
|
||||
<name>log4jdbc</name>
|
||||
<description>log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system.</description>
|
||||
<url>https://github.com/arthurblake/log4jdbc</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
<comments>A business-friendly OSS license</comments>
|
||||
</license>
|
||||
</licenses>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<sourceDirectory>src-jdbc41</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+6
-3
@@ -1,5 +1,8 @@
|
||||
log4jdbc is built with Ant 1.8.x, JDK 1.4.x and JDK 1.6.x
|
||||
log4jdbc is built with Ant 1.8.x and JDK 1.6.x
|
||||
|
||||
The build.cmd file is useful for building both the jdbc 3 version (JDK 1.4) and
|
||||
the jdbc 4 version (under JDK 1.6) under windows. The javadoc.cmd file is
|
||||
The build.cmd file is useful for building both the jdbc 3 version (JDK 1.4) and
|
||||
the jdbc 4 version (under JDK 1.6) under windows. The javadoc.cmd file is
|
||||
useful for building javadoc (requires the 3rd party ydoc tool)
|
||||
|
||||
NOTE: as of 2015-09-30 the jdbc 3 version has been removed - not all build
|
||||
scripts may have been updated to reflect that.
|
||||
|
||||
+4
-16
@@ -1,23 +1,11 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM invoke the 1.4 and the 1.6 jvm each in turn
|
||||
REM for JDBC 3 and JDBC 4 versions respectively
|
||||
REM (JDBC 3 version removed as of 2015-09-30)
|
||||
REM invoke the 1.6 jvm for the JDBC 4 version
|
||||
|
||||
REM BTW, It's not actually necessary to use JDK 1.4
|
||||
REM if you don't happen to have it laying around,
|
||||
REM as the ant script properly sets the source
|
||||
REM and target java versions anyway.
|
||||
|
||||
set ANT_HOME=c:\apache-ant-1.8.2
|
||||
|
||||
set JAVA_HOME=C:\jdk\1.4.2_19
|
||||
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
|
||||
|
||||
call java -version
|
||||
call ant -Djdbc.level=3 -Djvm.ver=1.4 all
|
||||
|
||||
set JAVA_HOME=C:\jdk\1.6.0_30
|
||||
set ANT_HOME=c:\apache-ant-1.8.1
|
||||
set JAVA_HOME=C:\jdk\1.6.0_21
|
||||
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
|
||||
|
||||
call java -version
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@
|
||||
built with jdk 1.4.2_13 (for use with jdbc3)
|
||||
and/or jdk 1.6.0 (for use with jdbc4)
|
||||
|
||||
Copyright 2007-2012 Arthur Blake
|
||||
Copyright 2007-2015 Arthur Blake
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
|
||||
<!-- release version -->
|
||||
<property name="version" value="1.2"/>
|
||||
<property name="version" value="1.3"/>
|
||||
|
||||
<target name="all" depends="cleancompile,compile,cleanjar,jar"/>
|
||||
|
||||
@@ -99,11 +99,11 @@
|
||||
<delete dir="${apidocs}" />
|
||||
<mkdir dir="${apidocs}" />
|
||||
</target>
|
||||
|
||||
|
||||
<target name="cleanrelease" description="clean up any release files">
|
||||
<delete file="../log4jdbc-${version}.zip"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="clean" depends="cleanrelease,cleanjavadoc,cleanjar,cleancompile" description="clean up all build artifacts"/>
|
||||
|
||||
<target name="release" depends="cleanrelease" description="make a complete release distribution (a .jar zip and tar.gz file for release)">
|
||||
|
||||
+4
-10
@@ -1,19 +1,13 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM invoke the 1.4 and the 1.6 jvm each in turn
|
||||
REM for JDBC 3 and JDBC 4 versions respectively
|
||||
REM (JDBC 3 version removed as of 2015-09-30)
|
||||
REM invoke the 1.6 jvm for the JDBC 4 version
|
||||
|
||||
set ANT_HOME=c:\apache-ant-1.8.2
|
||||
set ANT_HOME=c:\apache-ant-1.8.1
|
||||
set ANT_OPTS=-Xmx512m
|
||||
|
||||
set JAVA_HOME=C:\jdk\1.4.2_19
|
||||
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
|
||||
|
||||
call java -version
|
||||
call ant -Djdbc.level=3 -Djvm.ver=1.4 ydoc.3
|
||||
|
||||
set JAVA_HOME=c:\jdk\1.6.0_30
|
||||
set JAVA_HOME=c:\jdk\1.6.0_21
|
||||
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
|
||||
|
||||
call java -version
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
rem *************************************************************************************************
|
||||
rem * *
|
||||
rem * Copyright 2007-2012 Arthur Blake *
|
||||
rem * Copyright 2007-2015 Arthur Blake *
|
||||
rem * *
|
||||
rem * Licensed under the Apache License, Version 2.0 (the "License"); *
|
||||
rem * you may not use this file except in compliance with the License. *
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# *************************************************************************************************
|
||||
# * *
|
||||
# * Copyright 2007-2012 Arthur Blake *
|
||||
# * Copyright 2007-2015 Arthur Blake *
|
||||
# * *
|
||||
# * Licensed under the Apache License, Version 2.0 (the "License"); *
|
||||
# * you may not use this file except in compliance with the License. *
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package net.sf.log4jdbc;
|
||||
|
||||
/**
|
||||
* Static utility methods for use throughout the project.
|
||||
*/
|
||||
public class Utilities {
|
||||
/**
|
||||
* Right justify a field within a certain number of spaces.
|
||||
* @param fieldSize field size to right justify field within.
|
||||
* @param field contents to right justify within field.
|
||||
* @return the field, right justified within the requested size.
|
||||
*/
|
||||
public static String rightJustify(int fieldSize, String field)
|
||||
{
|
||||
if (field==null)
|
||||
{
|
||||
field="";
|
||||
}
|
||||
StringBuffer output = new StringBuffer();
|
||||
for (int i=0, j = fieldSize-field.length(); i < j; i++)
|
||||
{
|
||||
output.append(' ');
|
||||
}
|
||||
output.append(field);
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
* Copyright 2007-2015 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -1597,7 +1597,7 @@ public class CallableStatementSpy extends PreparedStatementSpy implements Callab
|
||||
|
||||
public Array getArray(String parameterName) throws SQLException
|
||||
{
|
||||
String methodCall = "getURL(" + parameterName + ")";
|
||||
String methodCall = "getArray(" + parameterName + ")";
|
||||
try
|
||||
{
|
||||
return (Array) reportReturn(methodCall, realCallableStatement.getArray(parameterName));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
* Copyright 2007-2015 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
* Copyright 2007-2015 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
* Copyright 2007-2015 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
* Copyright 2007-2015 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2012 Arthur Blake
|
||||
* Copyright 2007-2015 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package net.sf.log4jdbc;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
import java.math.BigDecimal;
|
||||
@@ -308,7 +309,7 @@ public class PreparedStatementSpy extends StatementSpy implements PreparedStatem
|
||||
public void setBlob(int i, Blob x) throws SQLException
|
||||
{
|
||||
String methodCall = "setBlob(" + i + ", " + x + ")";
|
||||
argTraceSet(i, "(Blob)",
|
||||
argTraceSet(i, "(Blob)",
|
||||
x==null?null:("<Blob of size " + x.length() + ">"));
|
||||
try
|
||||
{
|
||||
@@ -541,9 +542,14 @@ public class PreparedStatementSpy extends StatementSpy implements PreparedStatem
|
||||
|
||||
public void setBytes(int parameterIndex, byte[] x) throws SQLException
|
||||
{
|
||||
//todo: dump array?
|
||||
String methodCall = "setBytes(" + parameterIndex + ", " + x + ")";
|
||||
argTraceSet(parameterIndex, "(byte[])", "<byte[]>");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : x) {
|
||||
sb.append(String.format("%02X", b));
|
||||
}
|
||||
argTraceSet(parameterIndex, "(byte[])", sb.toString());
|
||||
|
||||
try
|
||||
{
|
||||
realPreparedStatement.setBytes(parameterIndex, x);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user