Connectivity Guide > Connectivity Guide > Understanding JDBC Connectivity > JDBC Tracing > JDBC Driver Tracing Using Java Logging Package
Was this helpful?
JDBC Driver Tracing Using Java Logging Package
JDBC Driver trace output can be configured to be logged using the Java Logging package (java.util.logging). The JDBC Driver uses the following Java logger objects to output driver trace messages:
ingres.jdbc.trace.log
Logger used to enable driver trace output via Java Logging and the logger used to output the driver traces. An explicit tracing level must be configured for this logger to enable trace output. Traces are written to this logger at the INFO level, so a logging level of INFO is sufficient to enable Java Logging output.
ingres.jdbc.trace.drv
ingres.jdbc.trace.ds
ingres.jdbc.trace.msg
ingres.jdbc.trace.msg.tl
ingres.jdbc.trace.msg.nl
Loggers used to configure the trace level for each of the associated components. Each logger must have an explicit tracing level assigned to enable trace output of the associated component. The Java Logging levels correspond to JDBC Driver trace levels as follows:
Log Level        Trace Level
OFF              0 (none)
INFO             1
FINE             2
FINER            3
FINEST           4
ALL              5
If the system property ingres.jdbc.trace.log is defined, then driver tracing is written to the indicated log file and Java Logging is not used for trace output. If the system property ingres.jdbc.trace.log is not defined, then the Java Logger ingres.jdbc.trace.log is used if it is explicitly configured with a logging level of at least INFO. Tracing levels are determined by the logging levels of the loggers associated with the various driver components. The tracing level determines which trace outputs are written to the logging system. Logging output is written to the ingres.jdbc.trace.log logger at the INFO level regardless of the configured tracing levels.
DBMS Tracing Using Java Logging Package
DBMS trace output can be configured to be logged using the Java Logging package (java.util.logging). The JDBC Driver uses the following Java logger objects to output DBMS trace messages:
ingres.jdbc.dbms.trace.log
Logger used to enable DBMS trace output through Java Logging and the logger used to output the DBMS traces. An explicit tracing level must be configured for this logger to enable trace output. Traces are written to this logger at the INFO level, so a logging level of INFO is sufficient to enable Java Logging output.
If the system property ingres.jdbc.dbms.trace.log is defined, then DBMS tracing is written to the indicated log file and Java Logging is not used for trace output. If the system property ingres.jdbc.dbms.trace.log is not defined, then the Java Logger ingres.jdbc.dbms.trace.log is used if it is explicitly configured with a logging level of at least INFO. Logging output is written to the ingres.jdbc.dbms.trace.log at the INFO level.
Example Logging Configuration
A simple logging configuration file to enable JDBC Driver and DBMS logging can use the following settings:
ingres.jdbc.trace.log.handlers = java.util.logging.ConsoleHandler
ingres.jdbc.trace.log.level = INFO
ingres.jdbc.trace.drv.level = FINER
ingres.jdbc.dbms.trace.log.handlers = java.util.logging.ConsoleHandler
ingres.jdbc.dbms.trace.log.level = INFO
If the settings shown above are placed in a file, logging.properties, then the following command line can be used to run a Java program, App, with driver tracing enabled at level 3, DBMS tracing enabled, and output sent to the Java system console:
java -Djava.util.logging.config.file=logging.properties App
 
Last modified date: 01/30/2023