Enabling Intelligent Management in the WebSphere plug-in trace

Enable Intelligent Management in the WebSphere® plug-in trace by using the <traceSpecification> tag.

About this task

Use the <traceSpecification> tag to enable both control and request-based tracing. To enable this tracing, see Configuring trace on the WebSphere plug-in. For more information about the properties of the <traceSpecification> tag, see Dynamic Routing.

Procedure

  1. To set the :DEBUG control trace for webserver1 and webserver2, add the following code to the server.xml of the controller.
    <dynamicRouting>
     <traceSpecification name="default" specification=":DEBUG" webservers="webserver1, webserver2" />
    </dynamicRouting>

    This change is communicated to the web server if it is already connected to the Dynamic Routing service.

    Note: Set the name parameter to default to use the control trace specification. For more information, see Configuring trace on the WebSphere plug-in.
    Configure different control trace specifications for different web servers. For example:
    <dynamicRouting>
     <traceSpecification name="default" specification=":DEBUG" webservers="webserver1" />
     <traceSpecification name="default" specification="request.http:DEBUG" webservers="webserver2" />
    </dynamicRouting>
  2. To configure request-based trace specifications for webserver1, add the following code to the server.xml of the controller.
    <dynamicRouting>
     <traceSpecification name="custom1" specification="request.http:DEBUG" condition="uri = '/foo'" webservers="webserver1" />
    </dynamicRouting>
    Note: The condition property is required for request-based trace specifications. The condition property specifies an expression that is evaluated by Intelligent Management in the plug-in for each request. The specified trace specification is set for the requests that match the expression. For information about the format of the condition parameter, see Configuring trace on the WebSphere plug-in.
    Request-based trace specifications are evaluated in the order they are specified. If two trace specifications with same name are specified, the one that comes later takes precedence. In the following example, control.process:DEBUG is used for the control specification for webserver1:
    <dynamicRouting>
     <traceSpecification name="default" specification=":DEBUG" webservers="webserver1" />
     <traceSpecification name="default" specification="control.process:DEBUG" webservers="webserver1" />
    </dynamicRouting>
    Use "*" to set the trace specification for all the web servers that are connected to the Dynamic Routing service. If you have a specification value that contains actual webserver names, the webserver specification replaces the "*" specification, regardless of order, because of specificity. The order replacement occurs when both specifications are equally targeted for "*" or for the same webservers.
    <dynamicRouting>
     <traceSpecification name="default" specification=":DEBUG" webservers="*" />
     <traceSpecification name="custom1" specification="http.request.rules:DEBUG" condition="uri = '/foo'" webservers="webserver1,webserver3" />
     <traceSpecification name="custom2" specification="http.response:DEBUG" condition="uri = '/foo'" webservers="webserver1,webserver4" />
     <traceSpecification name="custom3" specification="http.request.select:DEBUG" condition="virtualhost = 'ibm.com'" webservers="*" />
    </dynamicRouting>