+

Search Tips | Advanced Search

Tracing

To help diagnose problems in a user-defined security exit, we can enable a trace facility, similar to that used by MQIPT.

Enable tracing by setting the route Trace property to a value in the range 1 - 5. See the entry for Trace in MQIPT route properties.

There will probably be more than one instance of the security exit running at the same time so individual entries in the trace file can be identified by using the thread identifier.

The tracing functions are initialized by MQIPT when the security exit is started; all you have to do is choose what information we want to trace. There are many tracing examples in the sample user exits. See Security exits.

The minimum requirements for tracing are an entry call, an exit call, and the data that we want to trace. For example:
/**
* This method is called to initialize the exit (for example, for 
* loading validation information) and place itself in a ready
* state to validate connection requests.
*/
public int init(IPTTrace t) {
final String strMethod = "CustomExit.init";

// Trace entry into this method
t.entry(strMethod);

// Trace useful information
t.data(strMethod, "Starting exit - MQIPT version " + getVersion());

// Perform initialization and load any data           
t.data(strMethod, "Ready for work");

// Trace exit from this method
t.exit(strMethod);

return 0;
}
Parent topic: Security exits

Last updated: 2020-10-04