Debug Trace Policy Context Variables
Debug Trace Policy Context Variables
gateway92
The Debug Trace Policy context variables have meaning only when used in a debug trace policy, or within a policy fragment that is included in a debug trace policy. If called from any other policy, these variables will be interpolated as blank (unless the
template.strictmode
cluster property is enforced, in which case the calling assertion fails).Variable | Description |
---|---|
trace.service.oid | The internal object identifier of the published service with the policy currently being traced. |
trace.service.name | The name of the published service with the policy currently being traced. |
trace.policy.guid | The GUID of the policy containing the assertion that just executed. |
trace.policy.name | The name of the policy containing the assertion that just executed. |
trace.policy.version | The policy version number that is active in the policy containing the assertion that just executed. |
trace.assertion.number | This is a multivalued variable that contains the full path to the traced assertion, with each position in the path as a separate value. For example, for "3.2.17 Compare Expression", this variable will contain the values "3", "2", "17". |
trace.assertion.numberStr | Similar to trace.assertion.number above, except the full path is recorded as an assertion number; for example, "3.2.17". |
trace.assertion.ordinal | The ordinal of the assertion within its policy fragment. Using the "Compare Expression" example under trace.assertion.number above, this will be "17". |
trace.assertion.shortName | The short name of the assertion; for example "Continue Processing". |
trace.assertion.xml | The raw XML code for the assertion; useful for deeper inspection. Use this variable carefully, as it will further impact system performance during debug tracing. |
trace.status | The assertion status code returned by the assertion that just finished. A status of "0" means the assertion succeeded. Any other status means the assertion failed. |
trace.status.message | The text from the assertion status code message; for example, "Authentication Failed". |
trace.request | The original request message from the policy being traced. |
trace.response | The original response message from the policy being traced. Take care not to modify the original request or response within the trace policy to avoid affecting the behavior of the policy being traced. Even strictly read-only operations like XPath or schema validation may affect the exact behavior of the original policy in subtle ways by changing how and when the XML is parsed or the data is read. |
trace.var. <variableName> | Returns the contents of the ${variableName} context variable from the policy being traced. The ${variableName} variable can be any context variable that has been set in the policy up to that point. |
trace.final | This variable is set to "true" for the final trace invocation, after the last assertion has finished for this request. |
trace.out | This is a special utility variable that is empty initially. It is normally used to accumulate trace information during debug tracing. |
trace.assertion.start.ms | The start time of the assertion, measured down to the millisecond. |
trace.assertion.latency.ms | The latency of the assertion, in milliseconds. This is the amount of time that the assertion works on a message. |