+

Search Tips   |   Advanced Search

Enable Trace Based on Specific Request Content

Use centralized logging to perform a per-request trace analysis and follow the flow of a request through both the ODR and application server tiers.

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


Tasks

Run the setReqBasedTracing.py script to enable or disable request-based tracing rules. The supported commands are included in the following list:

  1. Enable request-based tracing.
    ./wsadmin.sh -lang jython -f setReqBasedTracing.py enableReqBasedTracing 
    -ruleExpression:<expression> -odrTraceSpec:<trace strings> 
    -appServerTraceSpec:<trace string> -ruleID:<rule ID> 
    

    where

      -ruleExpression:<expression>

      Specifies an expression used to match the requests. (Required)

      -odrTraceSpec:<trace string>

      Specifies an ODR trace string that is set at run time for the requests that match the specified expression. If the parameter is not specified, the trace specification is not dynamically set. (Optional)

      -appServerTraceSpec:<trace string>

      Specifies an application server trace string that is set at run time for the requests that match the specified expression. If the parameter is not specified, the trace specification is not dynamically set. (Optional)

      -ruleID:<rule ID>

      ID for the request-based tracing rule. If the parameter is not specified, a rule ID is generated by the script in the form of ruleID-<time stamp>. (Optional)
  2. List all the rules.
    ./wsadmin.sh -lang jython -f setReqBasedTracing.py listRuleIDs 
    
  3. Disable request-based tracing.
    ./wsadmin.sh -lang jython -f setReqBasedTracing.py disableReqBasedTracing 
    -ruleIDs:<rule ID1>,<rule ID2>...,<ruleIDn>
    

    where

      -ruleIDs:<rule ID1>,<rule ID2>...,<ruleIDn>

      List of rule IDs to disable. (Required)

For more information on rule expressions, read about HTTP operands.

  • Use centralized logging to diagnose problems
  • Intelligent Management: HTTP operands