Setting Db2 trace in a JVM server
You can control tracing of Java™ applications that use the IBM® Data Server Driver for JDBC and SQLJ for Db2® using either a set of Java system properties or specific Liberty DataSource attributes.
The following JVM system properties can be set in the JVM profile to trace applications that use the DriverManager interface to connect to Db2.
-Ddb2.jcc.traceDirectory=/u/<userID>/db2trace/
-Ddb2.jcc.traceFile=jccTrace.txt
-Ddb2.jcc.appendFile=true
-Ddb2.jcc.traceLevel=-1
The following data source properties can be used on a Liberty dataSource element
to activate tracing in a Liberty JVM server.
<properties.db2.jcc appendFile="true" traceDirectory="/u/<userID>/db2trace" traceFile="jccTrace.txt" traceLevel="-1"/>
The following JVM system properties can be set in the JVM profile to override any trace settings for applications that use either a DriverManager or a DataSource interface.
-Ddb2.jcc.override.traceDirectory=/u/<userID>/db2trace/
-Ddb2.jcc.override.traceFile=jccTrace.txt
-Ddb2.jcc.override.appendFile=true
-Ddb2.jcc.override.traceLevel=-1
When the JVM profile override properties are used for Liberty DriverManager, multiple _global_n files per TASK/REQUEST are appended.
When the JVM profile override properties are used for Liberty DataSource, a single _global_1 file contains all TASK/REQUESTS that are appended.