Loading

How to enable debug trace at Oracle JDBC driver level

Data pubblicazione: Jul 28, 2025
Operazione

GOAL

Certain Oracle JDBC driver supports the extra debugging feature, which will be useful if you would like to troubleshoot the JDBC connection at the Oracle JDBC driver level. 
Fasi
1. Make sure you are using the ojdbc jar with the suffix "_g", e.g. ojdbc8_g.jar, in the Database Connector configuration.

2.  Configure the database driver dependency in the pom.xml file.
Note the suffix "_g" for artifactId and suffix ".debug" for groupId. ENSURE you only have the dependency with the _g suffix. Remove the dependency referring to driver without the suffix.

An example of the Maven Dependency is:
ADD
<dependency>
	<groupId>com.oracle.database.jdbc.debug</groupId>
	<artifactId>ojdbc8_g</artifactId>
	<version>21.1.0.0</version>
	<type>jar</type>
</dependency>
REMOVE
<dependency>
	<groupId>com.oracle.database.jdbc</groupId>
	<artifactId>ojdbc8</artifactId>
	<version>21.1.0.0</version>
	<type>jar</type>
</dependency>


For more details and other versions, you can review the information here: https://mvnrepository.com/artifact/com.oracle.database.jdbc.debug

3. Pass the logging configuration file ("java.util.logging.config.file") as a system property along with the "oracle.jdbc.Trace" system property as below:
 
mule -M-Djava.util.logging.config.file=<filepath>/myConfig.properties -M-Doracle.jdbc.Trace=true

You can refer to How can I set Mule and Java system properties at startup? for instructions on how to set system properties on different deployment targets.

In the myConfig.properties file, the following content is expected:
.level=SEVERE
oracle.jdbc.level=FINE
oracle.jdbc.handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=FINE
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter

ADDITIONAL INFORMATION

The logging configuration can be changed based on the desired outcome. Please refer to the below documentation on different handles and logging levels:
https://docs.oracle.com/cd/B28359_01/java.111/b31224/diagnose.htm

Example JDBC driver trace when running a query:
oracle.jdbc: Connection.logon: oracle.jdbc.driver.T4CConnection@1a379649
oracle.jdbc: Operating System Process Identifier (SPID): 756
oracle.jdbc: DRCP Enabled: false
Numero articolo Knowledge

001114792

 
Caricamento
Salesforce Help | Article