mirror of
https://github.com/encounter/log4jdbc.git
synced 2026-03-30 11:27:21 -07:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7355247886 | |||
| 00369eba9f | |||
| a02f682e7c | |||
| a5290edf4b | |||
| 9769dbc6dd | |||
| b0b69fdc64 | |||
| 1dd40a2f76 | |||
| bbf255e0b4 | |||
| 4ee6d5f745 | |||
| c83e89c194 | |||
| 5ac146eb77 | |||
| cab8caa20a | |||
| 6484ab0c10 | |||
| de7d4acc84 | |||
| 108d89b8bc | |||
| 076a585184 | |||
| 1d455b77e6 | |||
| e33eb5534f | |||
| 15a798c27a | |||
| e227d3ca26 | |||
| 98f98d605c | |||
| c19443a574 | |||
| de256617a2 | |||
| eac61725f6 | |||
| f7fa0cdaf4 | |||
| 2223543ff0 | |||
| 89ed31f0b8 | |||
| 29b2b01ee1 | |||
| 0a4f5267df | |||
| a7ebd7eb1f |
+110
-52
@@ -1,3 +1,61 @@
|
||||
2010-06-09 1.2 beta 2 Release
|
||||
|
||||
o add new option, log4jdbc.auto.load.popular.drivers for
|
||||
disabling auto-loading of drivers
|
||||
|
||||
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,
|
||||
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
|
||||
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
|
||||
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 various other fixes (including Issues 8 and 9)
|
||||
|
||||
2009-02-26 1.2 alpha 2 Release
|
||||
|
||||
o (Issue 1) fix bug where batch of logged SQL wasn't cleared
|
||||
properly when using batched SQL.
|
||||
|
||||
o Added log4jdbc.statement.warn system property; defaults to false.
|
||||
|
||||
This is a new option to control the SQL Statement warnings in the
|
||||
log. When Statement objects are used by the application, the SQL
|
||||
in the log is preceded by "{WARNING: Statement used to run SQL}"
|
||||
This was always on in previous releases. Now it
|
||||
is off by default, and can be turned on by setting this property.
|
||||
|
||||
o (Issue 2) add getter methods across the board for the real
|
||||
wrapped object.
|
||||
|
||||
2008-11-08 1.2 alpha 1 Release
|
||||
|
||||
o added a new logger "jdbc.connection" to dump connection open and
|
||||
@@ -5,112 +63,112 @@
|
||||
is very useful for hunting down connection leak problems.
|
||||
|
||||
o several new options to produce better SQL output:
|
||||
|
||||
log4jdbc.dump.booleanastruefalse - many RDBMS's don't have a
|
||||
native boolean type and store booleans as a 1 or 0. Setting this
|
||||
option to false will show boolean bind variables as 1 or 0.
|
||||
Setting this to true will show the boolean as true or false.
|
||||
(Note that the default for this setting is false, contrary to the
|
||||
|
||||
log4jdbc.dump.booleanastruefalse - many RDBMS's don't have a
|
||||
native boolean type and store booleans as a 1 or 0. Setting this
|
||||
option to false will show boolean bind variables as 1 or 0.
|
||||
Setting this to true will show the boolean as true or false.
|
||||
(Note that the default for this setting is false, contrary to the
|
||||
previous way log4jdbc worked.)
|
||||
|
||||
log4jdbc.dump.sql.maxlinelength - can be used to insert line
|
||||
|
||||
log4jdbc.dump.sql.maxlinelength - can be used to insert line
|
||||
breaks into long running SQL (at white space positions.)
|
||||
previous versions of log4jdbc did this automatically with a value
|
||||
previous versions of log4jdbc did this automatically with a value
|
||||
of 90 (the default value is 90.) This line breaking can be turned
|
||||
off completely by setting this to 0.
|
||||
|
||||
log4jdbc.dump.fulldebugstacktrace - can be used in extreme
|
||||
debugging circumstances when you want to be able to see the full
|
||||
stack trace in the debug output. Be extra careful when using
|
||||
|
||||
log4jdbc.dump.fulldebugstacktrace - can be used in extreme
|
||||
debugging circumstances when you want to be able to see the full
|
||||
stack trace in the debug output. Be extra careful when using
|
||||
this as it will obviously produce much much more logging output.
|
||||
|
||||
|
||||
o dump a null bind variable as NULL instead of <null> for more
|
||||
accurate and reuseable SQL output.
|
||||
|
||||
o several new options for controlling what types of SQL statements are
|
||||
logged:
|
||||
|
||||
|
||||
o several new options for controlling what types of SQL statements
|
||||
are logged:
|
||||
|
||||
log4jdbc.dump.sql.select default value is true
|
||||
log4jdbc.dump.sql.insert default value is true
|
||||
log4jdbc.dump.sql.update default value is true
|
||||
log4jdbc.dump.sql.delete default value is true
|
||||
log4jdbc.dump.sql.create default value is true
|
||||
|
||||
The default values for all of these are true, but they can be
|
||||
selectively turned on and off to filter out unwanted types of sql
|
||||
statements. For example, setting log4jdbc.dump.sql.delete will
|
||||
|
||||
The default values for all of these are true, but they can be
|
||||
selectively turned on and off to filter out unwanted types of sql
|
||||
statements. For example, setting log4jdbc.dump.sql.delete will
|
||||
cause all DELETE sql commands to not be logged.
|
||||
|
||||
|
||||
o A new option to add a semi colon to the end of the dumped sql:
|
||||
|
||||
|
||||
log4jdbc.dump.sql.addsemicolon default value is false
|
||||
|
||||
|
||||
Sometimes it's useful to use log4jdbc to produce sql scripts that
|
||||
can later be fed back into a SQL tool to execute against a
|
||||
database and this option can help to produce more re-useable sql
|
||||
can later be fed back into a SQL tool to execute against a
|
||||
database and this option can help to produce more re-useable sql
|
||||
output script data from a log file.
|
||||
|
||||
o added Microsoft SQL Server 2005 Driver
|
||||
(com.microsoft.sqlserver.jdbc.SQLServerDriver) to
|
||||
o added Microsoft SQL Server 2005 Driver
|
||||
(com.microsoft.sqlserver.jdbc.SQLServerDriver) to
|
||||
list of "well known" drivers that log4jdbc looks for at startup.
|
||||
(thanks to Rob Richards for pointing this out)
|
||||
|
||||
Note that the SQL Server 2000 Driver with the confusing name
|
||||
of (com.microsoft.jdbc.sqlserver.SQLServerDriver) is also still
|
||||
supported.
|
||||
|
||||
|
||||
o other miscellaneous improvements.
|
||||
|
||||
2008-04-11 1.1 Release
|
||||
|
||||
o upgrade to SLF4J 1.5. Note that log4jdbc should still work with
|
||||
o upgrade to SLF4J 1.5. Note that log4jdbc should still work with
|
||||
any older (or newer) version of SLF4J too.
|
||||
|
||||
o slightly better fault tolerance for when loading/probing of
|
||||
|
||||
o slightly better fault tolerance for when loading/probing of
|
||||
popular JDBC drivers fails for any reason.
|
||||
|
||||
2007-11-10 1.1 beta 1 Release
|
||||
|
||||
o added HSQLDB (org.hsqldb.jdbcDriver) and H2 (org.h2.Driver) to
|
||||
o added HSQLDB (org.hsqldb.jdbcDriver) and H2 (org.h2.Driver) to
|
||||
list of "well known" drivers that log4jdbc looks for at startup.
|
||||
|
||||
o added log4jdbc.sqltiming.warn.threshold and
|
||||
log4jdbc.sqltiming.error.threshold system property settings to
|
||||
greatly aid in finding slow running sql. Special thanks to
|
||||
|
||||
o added log4jdbc.sqltiming.warn.threshold and
|
||||
log4jdbc.sqltiming.error.threshold system property settings to
|
||||
greatly aid in finding slow running sql. Special thanks to
|
||||
Lilianne E. Blaze for the idea and initial implementation.
|
||||
|
||||
2007-07-25 1.1 alpha 2 Release
|
||||
|
||||
o JDBC 4.0 support!
|
||||
|
||||
o fix Null pointer exception bug that could happen with setObject
|
||||
|
||||
o fix Null pointer exception bug that could happen with setObject
|
||||
call on PreparedStatementSpy
|
||||
|
||||
o added MySQL (com.mysql.jdbc.Driver) and PostgreSQL
|
||||
(org.postgresql.Driver) to list of "well known" drivers that
|
||||
|
||||
o added MySQL (com.mysql.jdbc.Driver) and PostgreSQL
|
||||
(org.postgresql.Driver) to list of "well known" drivers that
|
||||
log4jdbc looks for at startup.
|
||||
|
||||
2007-05-29 1.1 alpha 1 Release
|
||||
|
||||
o Fixed problem where when sql timing log was the only log turned
|
||||
o Fixed problem where when sql timing log was the only log turned
|
||||
on, log4jdbc would not recognize that logging was on at all.
|
||||
|
||||
o report sql exceptions in the sql timing log as well (when they
|
||||
occured during sql execution) and prominently show that the sql
|
||||
FAILED, and display how long it tried to chug on the sql before
|
||||
o report sql exceptions in the sql timing log as well (when they
|
||||
occured during sql execution) and prominently show that the sql
|
||||
FAILED, and display how long it tried to chug on the sql before
|
||||
the exception was thrown.
|
||||
|
||||
o Switch to Simple Logging Facade for Java SLF4J instead of using
|
||||
log4j directly, so that any underlying logging system can be
|
||||
o Switch to Simple Logging Facade for Java SLF4J instead of using
|
||||
log4j directly, so that any underlying logging system can be
|
||||
easily used.
|
||||
|
||||
o option added to ant build script to generate javadoc with ydoc
|
||||
o option added to ant build script to generate javadoc with ydoc
|
||||
to include UML diagrams within the javadoc.
|
||||
|
||||
o dump batched sql correctly.
|
||||
|
||||
o add simple command line program (PostLogProfilerProcessor) for
|
||||
processing sqltiming log files to create a simple profiling
|
||||
o add simple command line program (PostLogProfilerProcessor) for
|
||||
processing sqltiming log files to create a simple profiling
|
||||
report from log data.
|
||||
|
||||
2007-04-21 Initial 1.0 Release
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
log4jdbc is open source software, released under the Apache License, Version 2.0:
|
||||
|
||||
Copyright 2007-2008 Arthur Blake
|
||||
Copyright 2007-2010 Arthur Blake
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use log4jdbc except in compliance with the License.
|
||||
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
[this software is open source, released under the Apache License, Version 2.0: see LICENSE file]
|
||||
|
||||
Please see the main log4jdbc web page at http://log4jdbc.sourceforge.net for detailed features and usage information.
|
||||
There should also be in this folder, a copy of the main web page as it existed when this release was made.
|
||||
See index.html.
|
||||
Please see the main log4jdbc web page at http://log4jdbc.googlecode.com for detailed features and usage information.
|
||||
|
||||
@@ -18,3 +18,5 @@ o review dumpedSql method - make auto line breaking option (& num chars used) b
|
||||
o need log4jdbc.debug.stack.regex so that the stack matching can take place via regex
|
||||
|
||||
o maven2 repository support
|
||||
|
||||
o this may be a better solution to SimpleDateFormat contention issue: http://www.javaspecialists.eu/archive/Issue172.html
|
||||
|
||||
-596
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 996 B |
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
red in logo is #f06
|
||||
purple in logo is #ef39e9
|
||||
*/
|
||||
|
||||
.left {text-align:left;}
|
||||
.right{text-align:right;}
|
||||
.usage {text-align:left;}
|
||||
h1 {font-size:1em;color:#f06;background-color:#eee;display:block;padding:0.8em;}
|
||||
h2 {font-size:1.2em;color:#f06;background-color:#eee;display:block;height:2em;padding-top:0.8em;}
|
||||
h3 {font-size:1.1em;color:0;font-weight:bold;margin:5px;}
|
||||
a {text-decoration:none;}
|
||||
a:link {color: #f06;}
|
||||
a:visited {color: #f06;}
|
||||
p {padding:10px;}
|
||||
span.file {font-weight:bold;}
|
||||
ul {padding:10px;list-style:square}
|
||||
ol {padding:10px;list-style:decimal;}
|
||||
|
||||
ul li {margin-left:2em;padding:0.3em;}
|
||||
ol li {margin-left:2em;padding:0.3em;}
|
||||
|
||||
li p {margin-left:0;}
|
||||
|
||||
code,pre {color:navy;background-color:beige;font-size:11pt;}
|
||||
|
||||
pre {border:2px dashed navy;margin-left:3em;margin-right:4em;margin-top:1em;margin-bottom:1em;white-space:pre-line;}
|
||||
|
||||
.copyright {font-size:0.8m;text-align:center}
|
||||
.copyright a {color:#ef39e9}
|
||||
.sflogo {float:right; margin-right:30px;}
|
||||
|
||||
table.options {margin-left:40px;margin-right:20px;border:1px solid black;border-collapse:collapse;}
|
||||
table.options thead th {text-align:center;border:1px solid black; padding:5px}
|
||||
table.options tbody td {text-align:left;border:1px solid black; padding:5px}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
Binary file not shown.
+4
-3
@@ -1,4 +1,5 @@
|
||||
To build log4jdbc, you must have Ant 1.6.5 or later installed,
|
||||
and JDK 1.4 and JDK 1.6 installed.
|
||||
log4jdbc is built with Ant 1.8.x, JDK 1.4.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 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)
|
||||
|
||||
+14
-8
@@ -1,18 +1,24 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem this is a bit convoluted because two jdk's must be invoked...
|
||||
REM invoke the 1.4 and the 1.6 jvm each in turn
|
||||
REM for JDBC 3 and JDBC 4 versions respectively
|
||||
|
||||
set ANT_HOME=c:\apache-ant-1.6.5
|
||||
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 JAVA_HOME=C:\j2sdk1.4.2_13
|
||||
set ANT_HOME=c:\apache-ant-1.8.1
|
||||
|
||||
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
|
||||
|
||||
call ant -Djdbc.level=3 all
|
||||
|
||||
set JAVA_HOME=C:\jdk1.6.0_10
|
||||
set JAVA_HOME=C:\jdk\1.6.0_18
|
||||
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
|
||||
call java -version
|
||||
|
||||
call ant -Djdbc.level=4 all
|
||||
call java -version
|
||||
call ant -Djdbc.level=4 -Djvm.ver=1.6 all
|
||||
|
||||
+27
-33
@@ -6,17 +6,17 @@
|
||||
|
||||
Tested with Apache Ant version 1.6.5 & 1.7
|
||||
|
||||
built with jdk 1.4.2_13 (for use with jdbc3)
|
||||
built with jdk 1.4.2_13 (for use with jdbc3)
|
||||
and/or jdk 1.6.0 (for use with jdbc4)
|
||||
|
||||
Copyright 2007-2008 Arthur Blake
|
||||
|
||||
Copyright 2007-2010 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.
|
||||
@@ -28,18 +28,19 @@
|
||||
<project name="log4jdbc" default="all" basedir="..">
|
||||
|
||||
<!-- the jdbc.level flag should be set externally to either 3 or 4
|
||||
|
||||
this is the jdbc version and should be 3 if using a jdk 1.4 or 1.5 (jdk 1.4 is recommended for maximum compatibility)
|
||||
|
||||
|
||||
this is the jdbc version and should be 3 if using a jdk 1.4 or 1.5
|
||||
|
||||
the jdbc.level flag should be set to 4 if using a jdk 1.6 or greater.
|
||||
|
||||
defaults to jdbc3 build if not set externally
|
||||
|
||||
defaults to jdbc3 build if not set externally
|
||||
|
||||
therefore to build both, ant should be invoked twice, setting the jdbc.level externally
|
||||
to 3 and then 4. and using the jdk 1.4 and then 1.6.
|
||||
-->
|
||||
|
||||
<property name="jdbc.level" value="3" />
|
||||
<property name="jvm.ver" value="1.4" />
|
||||
<property name="jdbc.prefix" value="jdbc${jdbc.level}" />
|
||||
|
||||
<property name="src" value="src-${jdbc.prefix}" />
|
||||
@@ -48,19 +49,19 @@
|
||||
|
||||
|
||||
<!-- release version -->
|
||||
<property name="version" value="1.2alpha1"/>
|
||||
<property name="version" value="1.2beta2"/>
|
||||
|
||||
<target name="all" depends="cleancompile,compile,cleanjar,jar"/>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
The ydoc.home.3 and ydoc.home.4 properties are only used for the ydoc.3
|
||||
and ydoc.4 targets for producing javadoc with UML
|
||||
|
||||
it requires the commercial ydoc utility
|
||||
|
||||
it requires the commercial ydoc utility
|
||||
(see http://www.yworks.com/en/products_ydoc.htm)
|
||||
|
||||
|
||||
use the javadoc target to generate regular javadoc
|
||||
|
||||
|
||||
ydoc.home.3 is for jdk1.4 / JDBC 3
|
||||
ydoc.home.4 is for jdk1.6 / JDBC 4
|
||||
-->
|
||||
@@ -68,7 +69,8 @@
|
||||
<property name="ydoc.home.4" value="/ydoc-2.2_04-jdk1.5"/>
|
||||
|
||||
<target name="compile" description="compile all the source code">
|
||||
<javac srcdir="${src}" destdir="${classes}" deprecation="true" debug="true">
|
||||
<javac source="${jvm.ver}" target="${jvm.ver}" srcdir="${src}" destdir="${classes}"
|
||||
deprecation="true" debug="true" includeAntRuntime="false">
|
||||
<classpath>
|
||||
<pathelement location="$src"/>
|
||||
<fileset dir="lib">
|
||||
@@ -82,7 +84,7 @@
|
||||
<delete dir="${classes}"/>
|
||||
<mkdir dir="${classes}"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="jar" description="jar up all the class files">
|
||||
<mkdir dir="build"/>
|
||||
<jar jarfile="build/log4${jdbc.prefix}-${version}.jar" basedir="${classes}"/>
|
||||
@@ -93,26 +95,21 @@
|
||||
</target>
|
||||
|
||||
|
||||
<target name="cleanjavadoc">
|
||||
<target name="cleanjavadoc" description="clean javadoc">
|
||||
<delete dir="${apidocs}" />
|
||||
<mkdir dir="${apidocs}" />
|
||||
</target>
|
||||
|
||||
<target name="cleanrelease">
|
||||
|
||||
<target name="cleanrelease" description="clean up any release files">
|
||||
<delete file="../log4jdbc-${version}.zip"/>
|
||||
<delete file="../log4jdbc-${version}.tar"/>
|
||||
<delete file="../log4jdbc-${version}.tar.gz"/>
|
||||
</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)">
|
||||
<zip destfile="../log4jdbc-${version}.zip">
|
||||
<zipfileset dir="." prefix="log4jdbc-${version}" excludes="*.zip,*.tar.gz,*,iml,*.ipr,*.iws,thirdparty-stuff/**,classes*/**"/>
|
||||
</zip>
|
||||
<tar destfile="../log4jdbc-${version}.tar">
|
||||
<tarfileset dir="." prefix="log4jdbc-${version}" excludes="*.zip,*.tar.gz,*,iml,*.ipr,*.iws,thirdparty-stuff/**,classes*/**"/>
|
||||
</tar>
|
||||
<gzip destfile="../log4jdbc-${version}.tar.gz" src="../log4jdbc-${version}.tar"/>
|
||||
<delete file="../log4jdbc-${version}.tar"/>
|
||||
</target>
|
||||
|
||||
<!-- make the javadoc (or ydoc which includes UML diagrams) -->
|
||||
@@ -162,7 +159,7 @@
|
||||
<!-- note that the jdk source code is referenced here so that javadoc will be generated from
|
||||
interface class methods when none is specified in the implementation -->
|
||||
|
||||
<sourcepath path="/j2sdk1.4.2_13/src"/>
|
||||
<sourcepath path="/jdk/1.4.2_18/src"/>
|
||||
<link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
|
||||
<!--
|
||||
<link href="http://java.sun.com/j2ee/1.4/docs/api/"/>
|
||||
@@ -209,11 +206,8 @@
|
||||
<!-- note that the jdk source code is referenced here so that javadoc will be generated from
|
||||
interface class methods when none is specified in the implementation -->
|
||||
|
||||
<sourcepath path="/jdk1.6.0_10/src"/>
|
||||
<sourcepath path="/jdk/1.6.0_11/src"/>
|
||||
<link href="http://java.sun.com/javase/6/docs/api/"/>
|
||||
<!--
|
||||
<link href="http://java.sun.com/j2ee/1.4/docs/api/"/>
|
||||
-->
|
||||
<link href="http://www.slf4j.org/api/"/>
|
||||
|
||||
<!-- ydoc doclet for UML diagrams, see http://www.yworks.com/en/products_ydoc.htm -->
|
||||
|
||||
+9
-9
@@ -1,20 +1,20 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem run ydoc for jdbc 3 with jdk 1.4 and
|
||||
rem run ydoc for jdbc 4 with jdk 1.6
|
||||
REM invoke the 1.4 and the 1.6 jvm each in turn
|
||||
REM for JDBC 3 and JDBC 4 versions respectively
|
||||
|
||||
set ANT_HOME=c:\apache-ant-1.6.5
|
||||
set ANT_HOME=c:\apache-ant-1.8.1
|
||||
set ANT_OPTS=-Xmx512m
|
||||
|
||||
set JAVA_HOME=C:\j2sdk1.4.2_13
|
||||
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
|
||||
|
||||
call ant -Djdbc.level=3 ydoc.3
|
||||
|
||||
set JAVA_HOME=c:\jdk1.6.0_10
|
||||
set JAVA_HOME=c:\jdk\1.6.0_18
|
||||
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
|
||||
call java -version
|
||||
|
||||
call ant -Djdbc.level=4 ydoc.4
|
||||
call java -version
|
||||
call ant -Djdbc.level=4 -Djvm.ver=1.6 ydoc.4
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
rem *************************************************************************************************
|
||||
rem * *
|
||||
rem * Copyright 2007-2008 Arthur Blake *
|
||||
rem * Copyright 2007-2010 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. *
|
||||
@@ -25,4 +25,4 @@ rem * profiling output report.
|
||||
rem * *
|
||||
rem *************************************************************************************************
|
||||
|
||||
java -Xmx1024m -classpath ..\build\log4jdbc3-1.2alpha1.jar net.sf.log4jdbc.PostLogProfilerProcessor %*
|
||||
java -Xmx1024m -classpath ..\build\log4jdbc3-1.2beta2.jar net.sf.log4jdbc.PostLogProfilerProcessor %*
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
# *************************************************************************************************
|
||||
# * *
|
||||
# * Copyright 2007-2008 Arthur Blake *
|
||||
# * Copyright 2007-2010 Arthur Blake *
|
||||
# * *
|
||||
# * Licensed under the Apache License, Version 2.0 (the "License"); *
|
||||
# * you may not use this file except in compliance with the License. *
|
||||
@@ -25,4 +25,4 @@
|
||||
# * *
|
||||
# *************************************************************************************************
|
||||
|
||||
java -Xmx1024m -classpath ../build/log4jdbc3-1.2alpha1.jar net.sf.log4jdbc.PostLogProfilerProcessor $@
|
||||
java -Xmx1024m -classpath ../build/log4jdbc3-1.2beta2.jar net.sf.log4jdbc.PostLogProfilerProcessor $@
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2008 Arthur Blake
|
||||
* Copyright 2007-2010 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,6 +49,16 @@ public class CallableStatementSpy extends PreparedStatementSpy implements Callab
|
||||
*/
|
||||
private CallableStatement realCallableStatement;
|
||||
|
||||
/**
|
||||
* Get the real underlying CallableStatement that this CallableStatementSpy wraps.
|
||||
*
|
||||
* @return the real underlying CallableStatement.
|
||||
*/
|
||||
public CallableStatement getRealCallableStatement()
|
||||
{
|
||||
return realCallableStatement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a CallableStatementSpy (JDBC 3 version) to spy upon a CallableStatement.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2008 Arthur Blake
|
||||
* Copyright 2007-2010 Arthur Blake
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,8 +29,6 @@ import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Wraps a JDBC Connection and reports method calls, returns and exceptions.
|
||||
*
|
||||
@@ -42,6 +40,16 @@ public class ConnectionSpy implements Connection, Spy
|
||||
{
|
||||
private Connection realConnection;
|
||||
|
||||
/**
|
||||
* Get the real underlying Connection that this ConnectionSpy wraps.
|
||||
*
|
||||
* @return the real underlying Connection.
|
||||
*/
|
||||
public Connection getRealConnection()
|
||||
{
|
||||
return realConnection;
|
||||
}
|
||||
|
||||
private SpyLogDelegator log;
|
||||
|
||||
private final Integer connectionNumber;
|
||||
@@ -56,7 +64,7 @@ public class ConnectionSpy implements Connection, Spy
|
||||
/**
|
||||
* Get a dump of how many connections are open, and which connection numbers
|
||||
* are open.
|
||||
*
|
||||
*
|
||||
* @return an open connection dump.
|
||||
*/
|
||||
public static String getOpenConnectionsDump()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2007-2008 Arthur Blake
|
||||
* Copyright 2007-2010 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,8 @@
|
||||
*/
|
||||
package net.sf.log4jdbc;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Driver;
|
||||
@@ -33,9 +35,11 @@ import java.util.TreeSet;
|
||||
* A JDBC driver which is a facade that delegates to one or more real underlying
|
||||
* JDBC drivers. The driver will spy on any other JDBC driver that is loaded,
|
||||
* simply by prepending <code>jdbc:log4</code> to the normal jdbc driver URL
|
||||
* used by any other JDBC driver. The driver also loads several well known
|
||||
* drivers at class load time, so that this driver can be "dropped in" to any
|
||||
* java program that uses these drivers without making any code changes.
|
||||
* used by any other JDBC driver. The driver, by default, also loads several
|
||||
* well known drivers at class load time, so that this driver can be
|
||||
* "dropped in" to any Java program that uses these drivers without making any
|
||||
* code changes.
|
||||
* <p/>
|
||||
* The well known driver classes that are loaded are:
|
||||
* <p/>
|
||||
* <p/>
|
||||
@@ -58,10 +62,15 @@ import java.util.TreeSet;
|
||||
* </code>
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Additional drivers can be set via a system property: <b>log4jdbc.drivers</b>
|
||||
* Additional drivers can be set via a property: <b>log4jdbc.drivers</b>
|
||||
* This can be either a single driver class name or a list of comma separated
|
||||
* driver class names.
|
||||
* <p/>
|
||||
* The autoloading behavior can be disabled by setting a property:
|
||||
* <b>log4jdbc.auto.load.popular.drivers</b> to false. If that is done, then
|
||||
* the only drivers that log4jdbc will attempt to load are the ones specified
|
||||
* in <b>log4jdbc.drivers</b>.
|
||||
* <p/>
|
||||
* If any of the above driver classes cannot be loaded, the driver continues on
|
||||
* without failing.
|
||||
* <p/>
|
||||
@@ -154,6 +163,14 @@ public class DriverSpy implements Driver
|
||||
*/
|
||||
static int DumpSqlMaxLineLength;
|
||||
|
||||
/**
|
||||
* If this is true, display a special warning in the log along with the SQL
|
||||
* when the application uses a Statement (as opposed to a PreparedStatement.)
|
||||
* Using Statements for frequently used SQL can sometimes result in
|
||||
* performance and/or security problems.
|
||||
*/
|
||||
static boolean StatementUsageWarn;
|
||||
|
||||
/**
|
||||
* Options to more finely control which types of SQL statements will
|
||||
* be dumped, when dumping SQL.
|
||||
@@ -180,19 +197,38 @@ public class DriverSpy implements Driver
|
||||
* under some circumstances.
|
||||
*/
|
||||
static boolean DumpFullDebugStackTrace;
|
||||
|
||||
/**
|
||||
* Attempt to Automatically load a set of popular JDBC drivers?
|
||||
*/
|
||||
static boolean AutoLoadPopularDrivers;
|
||||
|
||||
/**
|
||||
* Get a Long option from a system property and
|
||||
* Trim SQL before logging it?
|
||||
*/
|
||||
static boolean TrimSql;
|
||||
|
||||
/**
|
||||
* Coldfusion typically calls PreparedStatement.getGeneratedKeys() after
|
||||
* every SQL update call, even if it's not warranted. This typically produces
|
||||
* an exception that is ignored by Coldfusion. If this flag is true, then
|
||||
* any exception generated by this method is also ignored by log4jdbc.
|
||||
*/
|
||||
static boolean SuppressGetGeneratedKeysException;
|
||||
|
||||
/**
|
||||
* Get a Long option from a property and
|
||||
* log a debug message about this.
|
||||
*
|
||||
* @param propName System property key.
|
||||
* @param props Properties to get option from.
|
||||
* @param propName property key.
|
||||
*
|
||||
* @return the value of that System property key, converted
|
||||
* @return the value of that property key, converted
|
||||
* to a Long. Or null if not defined or is invalid.
|
||||
*/
|
||||
private static Long getLongOption(String propName)
|
||||
private static Long getLongOption(Properties props, String propName)
|
||||
{
|
||||
String propValue = System.getProperty(propName);
|
||||
String propValue = props.getProperty(propName);
|
||||
Long longPropValue = null;
|
||||
if (propValue == null)
|
||||
{
|
||||
@@ -215,21 +251,24 @@ public class DriverSpy implements Driver
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Long option from a system property and
|
||||
* Get a Long option from a property and
|
||||
* log a debug message about this.
|
||||
*
|
||||
* @param props Properties to get option from.
|
||||
* @param propName property key.
|
||||
*
|
||||
* @param propName System property key.
|
||||
*
|
||||
* @return the value of that System property key, converted
|
||||
* @return the value of that property key, converted
|
||||
* to a Long. Or null if not defined or is invalid.
|
||||
*/
|
||||
private static Long getLongOption(String propName, long defaultValue)
|
||||
private static Long getLongOption(Properties props, String propName,
|
||||
long defaultValue)
|
||||
{
|
||||
String propValue = System.getProperty(propName);
|
||||
String propValue = props.getProperty(propName);
|
||||
Long longPropValue;
|
||||
if (propValue == null)
|
||||
{
|
||||
log.debug("x " + propName + " is not defined (using default of " + defaultValue +")");
|
||||
log.debug("x " + propName + " is not defined (using default of " +
|
||||
defaultValue +")");
|
||||
longPropValue = new Long(defaultValue);
|
||||
}
|
||||
else
|
||||
@@ -250,15 +289,16 @@ public class DriverSpy implements Driver
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a String option from a system property and
|
||||
* Get a String option from a property and
|
||||
* log a debug message about this.
|
||||
*
|
||||
* @param propName System property key.
|
||||
* @return the value of that System property key.
|
||||
* @param props Properties to get option from.
|
||||
* @param propName property key.
|
||||
* @return the value of that property key.
|
||||
*/
|
||||
private static String getStringOption(String propName)
|
||||
private static String getStringOption(Properties props, String propName)
|
||||
{
|
||||
String propValue = System.getProperty(propName);
|
||||
String propValue = props.getProperty(propName);
|
||||
if (propValue == null || propValue.length()==0)
|
||||
{
|
||||
log.debug("x " + propName + " is not defined");
|
||||
@@ -272,18 +312,20 @@ public class DriverSpy implements Driver
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a boolean option from a system property and
|
||||
* Get a boolean option from a property and
|
||||
* log a debug message about this.
|
||||
*
|
||||
*
|
||||
* @param props Properties to get option from.
|
||||
* @param propName property name to get.
|
||||
* @param defaultValue default value to use if undefined.
|
||||
*
|
||||
*
|
||||
* @return boolean value found in property, or defaultValue if no property
|
||||
* found.
|
||||
*/
|
||||
private static boolean getBooleanOption(String propName, boolean defaultValue)
|
||||
private static boolean getBooleanOption(Properties props, String propName,
|
||||
boolean defaultValue)
|
||||
{
|
||||
String propValue = System.getProperty(propName);
|
||||
String propValue = props.getProperty(propName);
|
||||
boolean val;
|
||||
if (propValue == null)
|
||||
{
|
||||
@@ -312,18 +354,52 @@ public class DriverSpy implements Driver
|
||||
{
|
||||
log.debug("... log4jdbc initializing ...");
|
||||
|
||||
// look for additional driver specified in system properties
|
||||
DebugStackPrefix = getStringOption("log4jdbc.debug.stack.prefix");
|
||||
InputStream propStream =
|
||||
DriverSpy.class.getResourceAsStream("/log4jdbc.properties");
|
||||
|
||||
Properties props = new Properties(System.getProperties());
|
||||
if (propStream != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
props.load(propStream);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.debug("ERROR! io exception loading " +
|
||||
"log4jdbc.properties from classpath: " + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
propStream.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.debug("ERROR! io exception closing property file stream: " +
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
log.debug(" log4jdbc.properties loaded from classpath");
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug(" log4jdbc.properties not found on classpath");
|
||||
}
|
||||
|
||||
// look for additional driver specified in properties
|
||||
DebugStackPrefix = getStringOption(props, "log4jdbc.debug.stack.prefix");
|
||||
TraceFromApplication = DebugStackPrefix != null;
|
||||
|
||||
Long thresh = getLongOption("log4jdbc.sqltiming.warn.threshold");
|
||||
Long thresh = getLongOption(props, "log4jdbc.sqltiming.warn.threshold");
|
||||
SqlTimingWarnThresholdEnabled = (thresh != null);
|
||||
if (SqlTimingWarnThresholdEnabled)
|
||||
{
|
||||
SqlTimingWarnThresholdMsec = thresh.longValue();
|
||||
}
|
||||
|
||||
thresh = getLongOption("log4jdbc.sqltiming.error.threshold");
|
||||
thresh = getLongOption(props, "log4jdbc.sqltiming.error.threshold");
|
||||
SqlTimingErrorThresholdEnabled = (thresh != null);
|
||||
if (SqlTimingErrorThresholdEnabled)
|
||||
{
|
||||
@@ -331,51 +407,69 @@ public class DriverSpy implements Driver
|
||||
}
|
||||
|
||||
DumpBooleanAsTrueFalse =
|
||||
getBooleanOption("log4jdbc.dump.booleanastruefalse",false);
|
||||
getBooleanOption(props, "log4jdbc.dump.booleanastruefalse",false);
|
||||
|
||||
DumpSqlMaxLineLength = getLongOption("log4jdbc.dump.sql.maxlinelength", 90L).
|
||||
intValue();
|
||||
DumpSqlMaxLineLength = getLongOption(props,
|
||||
"log4jdbc.dump.sql.maxlinelength", 90L).intValue();
|
||||
|
||||
DumpFullDebugStackTrace =
|
||||
getBooleanOption("log4jdbc.dump.fulldebugstacktrace",false);
|
||||
getBooleanOption(props, "log4jdbc.dump.fulldebugstacktrace",false);
|
||||
|
||||
DumpSqlSelect = getBooleanOption("log4jdbc.dump.sql.select",true);
|
||||
DumpSqlInsert = getBooleanOption("log4jdbc.dump.sql.insert",true);
|
||||
DumpSqlUpdate = getBooleanOption("log4jdbc.dump.sql.update",true);
|
||||
DumpSqlDelete = getBooleanOption("log4jdbc.dump.sql.delete",true);
|
||||
DumpSqlCreate = getBooleanOption("log4jdbc.dump.sql.create",true);
|
||||
StatementUsageWarn =
|
||||
getBooleanOption(props, "log4jdbc.statement.warn",false);
|
||||
|
||||
DumpSqlSelect = getBooleanOption(props, "log4jdbc.dump.sql.select",true);
|
||||
DumpSqlInsert = getBooleanOption(props, "log4jdbc.dump.sql.insert",true);
|
||||
DumpSqlUpdate = getBooleanOption(props, "log4jdbc.dump.sql.update",true);
|
||||
DumpSqlDelete = getBooleanOption(props, "log4jdbc.dump.sql.delete",true);
|
||||
DumpSqlCreate = getBooleanOption(props, "log4jdbc.dump.sql.create",true);
|
||||
|
||||
DumpSqlFilteringOn = !(DumpSqlSelect && DumpSqlInsert && DumpSqlUpdate &&
|
||||
DumpSqlDelete && DumpSqlCreate);
|
||||
|
||||
DumpSqlAddSemicolon = getBooleanOption("log4jdbc.dump.sql.addsemicolon",false);
|
||||
DumpSqlAddSemicolon = getBooleanOption(props,
|
||||
"log4jdbc.dump.sql.addsemicolon", false);
|
||||
|
||||
AutoLoadPopularDrivers = getBooleanOption(props,
|
||||
"log4jdbc.auto.load.popular.drivers", true);
|
||||
|
||||
TrimSql = getBooleanOption(props, "log4jdbc.trim.sql", true);
|
||||
|
||||
SuppressGetGeneratedKeysException =
|
||||
getBooleanOption(props, "log4jdbc.suppress.generated.keys.exception",
|
||||
false);
|
||||
|
||||
// The Set of drivers that the log4jdbc driver will preload at instantiation
|
||||
// time. The driver can spy on any driver type, it's just a little bit
|
||||
// easier to configure log4jdbc if it's one of these types!
|
||||
|
||||
Set subDrivers = new TreeSet();
|
||||
subDrivers.add("oracle.jdbc.driver.OracleDriver");
|
||||
subDrivers.add("com.sybase.jdbc2.jdbc.SybDriver");
|
||||
subDrivers.add("net.sourceforge.jtds.jdbc.Driver");
|
||||
|
||||
// MS driver for Sql Server 2000
|
||||
subDrivers.add("com.microsoft.jdbc.sqlserver.SQLServerDriver");
|
||||
if (AutoLoadPopularDrivers)
|
||||
{
|
||||
subDrivers.add("oracle.jdbc.driver.OracleDriver");
|
||||
subDrivers.add("oracle.jdbc.OracleDriver");
|
||||
subDrivers.add("com.sybase.jdbc2.jdbc.SybDriver");
|
||||
subDrivers.add("net.sourceforge.jtds.jdbc.Driver");
|
||||
|
||||
// MS driver for Sql Server 2005
|
||||
subDrivers.add("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
||||
// MS driver for Sql Server 2000
|
||||
subDrivers.add("com.microsoft.jdbc.sqlserver.SQLServerDriver");
|
||||
|
||||
subDrivers.add("weblogic.jdbc.sqlserver.SQLServerDriver");
|
||||
subDrivers.add("com.informix.jdbc.IfxDriver");
|
||||
subDrivers.add("org.apache.derby.jdbc.ClientDriver");
|
||||
subDrivers.add("org.apache.derby.jdbc.EmbeddedDriver");
|
||||
subDrivers.add("com.mysql.jdbc.Driver");
|
||||
subDrivers.add("org.postgresql.Driver");
|
||||
subDrivers.add("org.hsqldb.jdbcDriver");
|
||||
subDrivers.add("org.h2.Driver");
|
||||
// MS driver for Sql Server 2005
|
||||
subDrivers.add("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
||||
|
||||
// look for additional driver specified in system properties
|
||||
String moreDrivers = getStringOption("log4jdbc.drivers");
|
||||
subDrivers.add("weblogic.jdbc.sqlserver.SQLServerDriver");
|
||||
subDrivers.add("com.informix.jdbc.IfxDriver");
|
||||
subDrivers.add("org.apache.derby.jdbc.ClientDriver");
|
||||
subDrivers.add("org.apache.derby.jdbc.EmbeddedDriver");
|
||||
subDrivers.add("com.mysql.jdbc.Driver");
|
||||
subDrivers.add("org.postgresql.Driver");
|
||||
subDrivers.add("org.hsqldb.jdbcDriver");
|
||||
subDrivers.add("org.h2.Driver");
|
||||
}
|
||||
|
||||
// look for additional driver specified in properties
|
||||
String moreDrivers = getStringOption(props, "log4jdbc.drivers");
|
||||
|
||||
if (moreDrivers != null)
|
||||
{
|
||||
@@ -384,7 +478,7 @@ public class DriverSpy implements Driver
|
||||
for (int i = 0; i < moreDriversArr.length; i++)
|
||||
{
|
||||
subDrivers.add(moreDriversArr[i]);
|
||||
log.debug (" will look for additional driver " + moreDriversArr[i]);
|
||||
log.debug (" will look for specific driver " + moreDriversArr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -424,11 +518,12 @@ public class DriverSpy implements Driver
|
||||
}
|
||||
|
||||
SqlServerRdbmsSpecifics sqlServer = new SqlServerRdbmsSpecifics();
|
||||
OracleRdbmsSpecifics oracle = new OracleRdbmsSpecifics();
|
||||
|
||||
/** create lookup Map for specific rdbms formatters */
|
||||
rdbmsSpecifics = new HashMap();
|
||||
rdbmsSpecifics.put("oracle.jdbc.driver.OracleDriver",
|
||||
new OracleRdbmsSpecifics());
|
||||
rdbmsSpecifics.put("oracle.jdbc.driver.OracleDriver", oracle);
|
||||
rdbmsSpecifics.put("oracle.jdbc.OracleDriver", oracle);
|
||||
rdbmsSpecifics.put("net.sourceforge.jtds.jdbc.Driver", sqlServer);
|
||||
rdbmsSpecifics.put("com.microsoft.jdbc.sqlserver.SQLServerDriver",
|
||||
sqlServer);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user