Testing your message flow by adding Trace nodes

By adding a Trace node to a message flow, you can write debugging messages to a file, to user trace, or to the system log, and review those messages after the message flow has processed some data.

About this task

You must add a Trace node when the message flow is designed. Viewing the logical message tree in trace output explains how to view the structure of the logical message tree at any point in the message flow, and contains an example of the message content. You can turn the Trace node off when a message flow is promoted to production to improve performance, but you can turn the node on when required. Performance can be affected when Trace nodes are active. The extent to which performance is affected depends on the destination that you choose for the debugging messages; for example, writing to user trace is typically faster than writing to a file or to the system log.

The debug messages can include writing part or all of the logical message tree, but they can also include hard-coded strings to identify a particular point in the message flow (such as PRINTF in a C program). If you write the entire message tree in a Trace node, the behavior of the message flow might be changed. Typically, only the parts of the message that are referenced are parsed, rather than the entire message.

Procedure

  • Add a Trace node to your message flow, then set the following properties on the node (as described in detail in Trace node):
    • Set the destination of the trace record that is written by the node to User Trace, Local Error Log, or File.
    • If you choose File, set the file path of the file to which to write records.
    • Use the Pattern property to create an ESQL pattern that specifies the data to be included in the trace record.
    • Specify the message catalog from which the error text for the error number of the exception is extracted.
    • Specify the error number of the message that is written.
  • After you have added a Trace node to your message flow, you can turn it on or off, as described in Switching Trace nodes on and off.
  • To view the structure of the logical message tree at any point in the message flow, include a Trace node and write some or all of the message (including headers and all four message trees) to the trace output destination. The following topics describes how to view that output: Viewing the logical message tree in trace output
  • If you write debugging messages to user trace, the following topic describes how to retrieve user trace: Retrieving user trace