Issue
The Java Database Connectivity (JDBC) API is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases and other tabular data sources, such as spreadsheets or flat files.
This article describes how to enable JDBC additional logging for debug purposes.
Resolution
10.6 and newer:
-
In the CloudBees CD Server, open the
logging-local.properties
file, which is located inyourInstallationPath/conf
, and append the following section:# Log all SQL DML statements as they are executed org.hibernate.SQL=TRACE # Log all JDBC parameters org.hibernate.type.descriptor.sql.BasicBinder=TRACE
-
Once these changes are saved, confirm the additional SQL trace logging lines are added to the
yourInstallationPath/logs/commander.log
file (in clustered installations the log is generated in the filecommander-yourHostName.log
) by checking if this command returns a count greater than 0:grep " SQL " commander.log | wc -l 3275
-
Do the same for BasicBinder trace logging:
grep " BasicBinder " commander.log | wc -l 234819
-
If this change does not take effect (previous grep commands return 0), restart the CloudBees CD (CloudBees Flow) server and run the grep commands again after restarting (this might be required for very busy servers).
-
Reproduce the issue that you are trying to debug.
-
Provide to the support team all the logs from the time you turned on JDBC logging until after the issue is reproduced.
Pre 10.6:
-
In the CloudBees CD Server, open the
logback-local.groovy
file, which is located inyourInstallationPath/conf
, and find the following section:// Log all SQL DML statements as they are executed logger("org.hibernate.SQL", TRACE) // Log all JDBC parameters logger("org.hibernate.type.descriptor.sql.BasicBinder", TRACE)
-
Ensure that the lines are uncommented and that the level is set to "TRACE".
-
Once these changes are saved, confirm the additional SQL trace logging lines are added to the
yourInstallationPath/logs/commander.log
file (in clustered installations the log is generated in the filecommander-yourHostName.log
) by checking if this command returns a count greater than 0:grep " SQL " commander.log | wc -l 3275
-
Do the same for BasicBinder trace logging:
grep " BasicBinder " commander.log | wc -l 234819
-
If this change does not take effect (previous grep commands return 0), restart the CloudBees CD (CloudBees Flow) server and run the grep commands again after restarting (this might be required for very busy servers).
-
Reproduce the issue that you are trying to debug.
-
Provide to the support team all the logs from the time you turned on JDBC logging until after the issue is reproduced.