Diagnosing Outbound REST and SOAP Requests from the Integration Agent

Introduction

This knowledge base article covers how you can log detailed, low-level messages about HTTP requests initiated by the Integration Agent.

The Integration Agent has well-documented capabilities for logging messages from high-level entities such as the Integration Service scripts, but some debugging tasks require information from lower-level entities, such as the HTTPClient components that handle network communication between the Integration Agent and other devices. For example, the Integration Agent might log error messages when sending REST or SOAP requests to external devices, but these messages won't provide enough detail to allow you to diagnose the problem.

Investigating this type of problem is often performed using external tools such as Wireshark, but you can get comparable levels of troubleshooting information from the Integration Agent itself, without installing external tools.

Configuring the Integration Agent to record wire-level log messages

To configure the Integration Agent to record detailed, low-level messages about HTTP requests initiated by the Integration Agent (and the corresponding responses):

  1. Add the following lines to <IAHome>\conf\log4j.xml at a suitable spot (for example, immediately prior to "<!-- All Integration Services -->"):
    <logger name="org.apache.http.wire">
                  <level value="DEBUG"/>
    </logger>
  2. Save the file and restart the Integration Agent.

Viewing the wire-level messages

The messages are written to the Integration Agent log file. They provide the same process and thread information as the Integration Service script that initiated the web request, but it should be fairly obvious in the log file that these messages are network-specific. For example:

2017/08/25 15:37:32.006 -0700 PDT [applications|sample-relevance-engine-1] 
DEBUG - >> "POST /reapi/2015-04-01/forms/4069a692-d848-497f-a267-2f84655fd076/triggers HTTP/1.1[\r][\n]"

In this example, the ">>" prefix indicates that this message contains information about an outgoing transmission from the Integration Agent. Messages with a "<<" prefix contain information about a response coming back to the Integration Agent.

Information included in the wire-level messages

In addition to the familiar details such as those shown in the message above, the wire-level messages include information about header, cookies and cookie management, and so on. In many ways, the information is the same as you would get from sending the request using cURL or POSTMan, but the wire messages provide information that is specific to the Integration Agent.

For example, the Integration Agent does not configure its HTTPClient component to perform preemptive authentication. This means if you try to diagnose Integration Agent connection problems using cURL, you won't get accurate information unless you use exactly the right flags and headers. However, the Integration Agent's wire messages provide this information without you needing to know all of the low-level details of the Integration Agent's components and their configuration.

Disabling wire-level log messages

You can easily disable wire-level logging. Simply comment out the lines you previously added to <IAHome>\conf\log4j.xml. For example:

  1. Replace:
    <logger name="org.apache.http.wire">
                  <level value="DEBUG"/>
    </logger>
    
    with
    <!-- Wire-level logging - causes logfile bloat if enabled while not needed 
    <logger name="org.apache.http.wire">
                  <level value="DEBUG"/>
    </logger>
    -->
  2. Save the file and restart the Integration Agent.

xMatters internal reference:
DOC-7328 Originally by Jeremy Brown

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk