IBM Support

How do I obtain trace information from my Java program using the Toolbox?

Question & Answer


Question

How do I obtain trace information from my Java program using the Toolbox?

Answer

Turn tracing on by doing the following inside of your Jav a program near the beginning of execution:

Trace.setTraceOn(true);
Trace.setTraceDiagnosticOn(true);
Trace.setTraceInformationOn(true);
Trace.setTraceWarningOn(true);
Trace.setTraceErrorOn(true);
Trace.setTraceDatastreamOn(true);
Trace.setTraceThread(true);
Trace.setTraceJDBCOn(true);
**Trace JDBC method available starting in V5R1**

OR

Trace.setTraceAllOn(true);

This will enable tracing and then enable tracing for each individual trace category. Each trace category is described below:

OR

Set the following Java system properties:

For example:

java
-Dcom.ibm.as400.access.Trace.category=error,warning,diagnostic
-Dcom.ibm.as400.access.Trace.file=/tmp/toolboxTrace.txt (If the Trace.file property isn't set, the output will go to "standard output".)

Note: The caller can enable or disable specific trace categories (by default all trace categories are disabled). Enabling or disabling one category does not affect other categories. When submitting problems, please enable all trace categories.

NOTE : If you are using JDBC, you will need to turn JDBC tracing on. This will trace JDBC configuration and execution information, which includes any exception stack traces. The easiest way to do this is to add " ;trace=true " to the end of your URL. In V5R1 you can also use the Trace.setTraceJDBCOn(true) method to turn JDBC tracing on.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Product Synonym

IBM i;AS400

Document Information

Modified date:
05 March 2020

UID

ibm11117275