Enabling Trace Based on Specific Request Content
You can use centralized logging to easily perform a per-request trace analysis and follow the flow of a request through both the ODR and application server tiers.
About this task
If the routing behavior for a specific type of request
is not as expected, it might be valuable to enable specific trace
strings during the time when the problem request is being processed.
Use request based tracing to dynamically enable tracing based on the
content of a request. Request based tracing uses matching rules to
specify what trace strings are enabled when requests arrive. If a
request arrives that matches a rule, the associated trace string is
enabled on the ODR as runtime trace. When the request is sent to the
backend application server, the runtime trace string for that backend
application server is set to the trace string associated with the
rule. When request processing is complete, the runtime trace string
is set to *=info
Procedure
setReqBasedTracing.py
script to
enable or disable request-based tracing rules. - enableReqBasedTracing
- Sets up a request-based tracing rule. A rule consists of an expression
and identifier called a rule ID. Optionally, a rule can also contain
ODR trace and application server trace strings. Start and end markers
are placed in the log files for requests that match one or more rules.
The ODR logs a start marker when a request that matches one or more rules arrives and logs an end marker before the request is dispatched to the backend application server. The ODR also logs a start marker when a response is received from the application server and an end marker after response is sent back to the user. The application server logs a start marker when a matched request arrives from the ODR and an end marker before a response is sent to the ODR. These markers make it possible to find a particular request, or set of requests, and to correlate them with processing of that request on the application server.
- listRuleIDs
- Lists all the rules. This command will output all the rules that are set on all the ODRs. After an ODR is restarted, the rules must be recreated.
- disableReqBasedTracing
- Disables a request-based tracing rule.