To include trace points in your application, complete the following
steps:
Define a final public static variable to hold each component identifier
you want to work with. For example, in the class MyClass, include
the following:
public static final String COMPID = "APPL1";
Note: Component identifiers are limited to 6 characters. Do not
use the number-sign character ( # ) in the first position, as this is reserved
for use by the toolkit.
Include an entry in the keyed collection trace.requesterComponents
of the configuration file for each component to be traced. Specify
the types and levels to be enabled for each component, as in the following
example:
For guidance, see Recommended combinations of types and levels.
Code a query of the Trace Facility at the trace point to determine
if the level and type are enabled for the code's component. This
is very important, in order to minimize the creation of unnecessary objects
and the resulting negative impact on performance.
If the previous step returns true, build the trace record and invoke
the Trace Facility.