Tracing in Java client programs

You can control tracing in Java™ client programs using:

It is recommended that applications implement an option to turn trace on.

The following is an explanation of the various trace levels available. The names of calls and properties are case sensitive.

Trace level
Standard
com.ibm.ctg.client.T call
T.setOn (true/false)
System property
gateway.T.trace=on
Definition
The standard option for application tracing.

By default, it displays only the first 128 bytes of any data blocks (for example the commarea, or network flows).

This trace level is equivalent to the Gateway trace set by the ctgstart –trace option.

Trace level
Full Debug
com.ibm.ctg.client.T call
T.setDebugOn (true/false)
System property
gateway.T=on
Definition
The debugging option for application tracing.

By default, it traces out the whole of any data blocks. The trace contains more information about the CICS® Transaction Gateway than the standard trace level.

This trace level is equivalent to the Gateway debug trace set by the ctgstart –x option.

Trace level
Exception Stacks
com.ibm.ctg.client.T call
T.setStackOn (true/false)
System property
gateway.T.stack=on
Definition
The exception stack option for application tracing.

It traces most Java exceptions, including exceptions which are expected during normal operation of the CICS Transaction Gateway. No other tracing is written.

This trace level is equivalent to the Gateway stack trace set by the ctgstart –stack option.

You can further configure the tracing by using the following options:
com.ibm.ctg.client.T call
T.setTFile(true,filename)
System property
gateway.T.setTFile=filename
Option usage
The value filename specifies a file location for writing of trace output. This is as an alternative to the default output on stderr. Long file names must be surrounded by quotation marks, for example: "trace output file.log"
com.ibm.ctg.client.T call
T.setTruncationSize(number)
System property
gateway.T.setTruncationSize=number
Option usage
The value number specifies the maximum size of any data blocks that will be written in the trace. Any positive integer is valid. If you specify a value of 0, then no data blocks will be written in the trace. If a negative value is assigned to this option the exception java.lang.IllegalArgumentException will be raised.
com.ibm.ctg.client.T call
T.setDumpOffset(number)
System property
gateway.T.setDumpOffset=number
Option usage
The value number specifies the offset from which displays of any data blocks will start. If the offset is greater than the total length of data to be displayed, an offset of 0 will be used. If a negative value is assigned to this option the exception java.lang.IllegalArgumentException will be raised.
com.ibm.ctg.client.T call
T.setTimingOn (true/false)
System property
gateway.T.timing=on
Option usage
Specifies whether or not to display time-stamps in the trace.

Use the options in addition to one of the directives to switch tracing on.

For example, the following switches standard tracing on, and sets the maximum size of any data blocks to be dumped to 20 000 bytes:
java -Dgateway.T.trace=on -Dgateway.T.setTruncationSize=20000