Trace is activated for the IBM.CTG.Client.dll either
by specifying it as an application configuration file or by using
the Trace class.
Trace levels
The following trace levels
are available:
- CtgTrcDisabled
- disables tracing
- CtgTrcLevel1
- includes exception trace points but nothing else
- CtgTrcLevel2
- includes event trace points and all CtgTrcLevel1 trace points
- CtgTrcLevel3
- includes function entry and exit trace points and all CtgTrcLevel1
and CtgTrcLevel2 trace points
- CtgTrcLevel4
- includes debug trace points and all CtgTrcLevel1, CtgTrcLevel2
and CtgTrcLevel3 trace points (the most verbose tracing level)
Specifying trace in an application configuration file
Trace
can be enabled using the CtgTrace trace switch in an application configuration
file (an XML file). The switch allows the trace to be specified as
an IBM.CTG.TraceLevel value, a System.Diagnostics.TraceLevel value,
or an integer between 0 and 4 inclusive. In the following example
the switch
value="CtgTrcLevel4" specifies Level 4
tracing, with tracing of data blocks limited to the first 128 bytes.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<switches>
<add name="CtgTrace" value="CtgTrcLevel4" dataDumpOffset="0" dataDumpLength="128"/>
</switches>
</system.diagnostics>
</configuration>
A sample trace configuration file called App.config
is included in the ctgredist package or in <install_path>\samples\csharp\eci
and <install_path>\samples\vb\eci on a Windows machine with CICS® Transaction Gateway installed.
Using the Trace class
The
Trace class includes the following members:
- TraceLevel
- gets or sets the trace level
- DataDumpOffset
- gets or sets the starting offset in each data blocks when tracing
at CtgTrcLevel4
- DataDumpLength
- gets or sets the maximum amount of data traced in each data block
at CtgTrcLevel4
For more information see Trace.