Managing Trace
Tracing can be activated either through a routing file or through a Security Access Manager server task administrative command.
The following information outlines details of the second method. For details on how to activate tracing through a routing file, see Customize logging events with tracing configuration files.
The server task trace command can be used to dynamically control trace operations. As with other Security Access Manager administrative functions, the trace command can be issued through either the pdadmin utility or programmatically through the Security Access Manager Administrative API.
- List all of the available trace points.
- Change the level and destination for specific trace points.
- Retrieve the trace point level for specific trace points.
Listing all trace commands
server task server name trace list
Where server
name specifies the name of the server on which you want
to collect trace information.pdadmin> server task PDWebPI-webpi.gc.au.ibm.com trace list
pdwebpi.request
pdwebpi.response
...
Adjusting the trace level of a component
server task <server name> trace set <component> \
<level> [file path=file|other-log-agent-config]
Where:- server name
- Specifies the name of the server on which you want to collect trace information.
- component
- Specifies the name of trace component as shown by the list command.
- level
- Controls the amount of detail to be gathered, in the range of 1 to 9, with 1 collecting the least number of traces, and 9 collecting the most number of traces.
- file path
- The optional file path parameter specifies the location for trace output. If this parameter is not supplied, the trace output is sent to the stdout stream of the server.
The following example sets the trace level to 9 for the pdwebpi.request component. Any output that is generated is sent to the /tmp/log.txt file on the WebPI server.
pdadmin> server task PDWebPI-wpi.com trace set pdwebpi.request 9
file path=/tmp/log.txt
Retrieving the current trace level of a component
server task server-name trace show [component]
If
the optional component parameter is omitted, the
output lists the name and level of all of the enabled trace components.pdadmin>server task PDWebPI-wpi.ibm.com trace show pdwebpi.request 9