JDBC Type 4 Driver Programmer's Reference for SQL/MX Release 3.1 (H06.23+, J06.12+)

Chapter 9. Tracing and Logging Facilities
Prev Next
Chapter 9. Tracing and Logging Facilities
Standard JDBC Tracing and Logging Facility
The Type 4 Driver Logging Facility
Accessing the Type 4 Driver Logging Facility
Controlling Type 4 Driver Logging Output
Message Format
Examples of Logging Output
Controlling the QueryExecuteTime Logging Facility
QueryExecuteTime logging Message Format
Examples of QueryExecuteTime Logging Output
The Type 4 driver provides two tracing and logging facilities:
Standard JDBC tracing and logging functionality as defined by the JDBC standard
Type 4 driver logging facility
MXCS (server-side) tracing (logging) is enabled by configuring MXCS. For information about MXCS tracing, see the NSM/Web online help.
Standard JDBC Tracing and Logging Facility
The JDBC standard provides a logging and tracing facility, which allows tracing JDBC method calls by setting the log writer. To set the log
writer, either call the
setLogWriter() method on the DriverManager class or call the setLogWriter() method on the DataSource class (or
ConnectionPoolDataSource class).
A DriverManager log writer is a character output stream to which all logging and tracing messages for all connections made through the
DriverManager are printed. This stream includes messages printed by the methods of this connection, messages printed by methods of other
objects manufactured by the connection, and so on. The
DriverManager log writer is initially null, that is, the default is for logging to be
disabled.
For information about using the setLogWriter method, see the DriverManager class API
(
http://download.oracle.com/javase/1.5.0/docs/api/java/sql/DriverManager.html).
A DataSource log writer is a character output stream to which all logging and tracing messages for this data source are printed. This stream
includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so
on. Messages printed to a data-source-specific log writer are not printed to the log writer associated with the java.sql.DriverManager class.
When a
DataSource object is created, the log writer is initially null; that is, the default is for logging to be disabled.
For information about using the
setLogWriter() method, see the DataSource interface API
(
http://download.oracle.com/javase/1.5.0/docs/api/javax/sql/DataSource.html).
The Type 4 Driver Logging Facility
Accessing the Type 4 Driver Logging Facility
Controlling Type 4 Driver Logging Output
Message Format
Examples of Logging Output
The Type 4 driver Logging facility allows you to retrieve internal tracing information, which you can use in debugging the driver. It also allows
you to capture error and warning messages.
In addition to the standard JDBC tracing and logging facility, the Type 4 driver provides an independent logging facility (Type 4 Driver Logging).
The Type 4 Driver Logging provides the same level of logging and tracing as the standard JDBC tracing and logging facility with the following
additional information:
More detail about the internals of the Type 4 driver and internal tracing information
Type 4 driver performance-tuning information
Finer control over the amount and type of logging information
Error and warning messages