IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Trace node

Use the Trace node to generate trace records that you can use to monitor the behavior of a message flow.

This topic contains the following sections:

Purpose

Trace records can incorporate text, message content, and date and time information, to help you to monitor the behavior of the message flow.

You can write the records to the user trace file, another file, or the local error log (which contains error and information messages written by all other IBM® Integration Bus components). If you write traces to the local error log, you can issue a message from the default message catalog that is supplied with IBM Integration Bus, or you can create your own message catalog.

The operation of the Trace node is independent of the setting of user tracing for the message flow that contains it. In particular, records that are written by the Trace node to the user trace log are written even if user trace is not currently active for the message flow.

The Trace node is contained in the Construction drawer of the palette, and is represented in the IBM Integration Toolkit by the following icon:

Trace node icon

Using this node in a message flow

Look at the following samples to see how to use this node:

You can view information about samples only when you use the product documentation that is integrated with the IBM Integration Toolkit or the online product documentation. You can run samples only when you use the product documentation that is integrated with the IBM Integration Toolkit.

Include a Trace node to help diagnose errors in your message flow. By tracing the contents of the message at various points in the flow, you can determine the sequence of processing. You can configure the Trace node to record the content of a message, and to check the action of a specific node on the message. For example, you can include a Trace node immediately after a Compute node to check that the output message has the expected format.

You can also use the Trace node to provide information in error handling in your message flows. For example, you can use this node to record failures in processing because of errors in the content or format of a message.

When you have tested the message flow and proved that its operation is correct, remove Trace nodes from your message flow, or switch them off.

Terminals and properties

When you have put an instance of the Trace node into a message flow, you can configure it; see Configuring a message flow node. The properties of the node are displayed in the Properties view. All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.

The terminals of the Trace node are described in the following table.

Terminal Description
In The input terminal that accepts a message for processing by the node.
Out The output terminal through which the message is propagated.

The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file to deploy it).

The Description properties of the Trace node are described in the following table.

Property M C Default Description
Node name No No The node type: Trace The name of the node.
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.

The Basic properties of the Trace node are described in the following table.

Property M C Default Description mqsiapplybaroverride command property
Destination Yes No User Trace The destination of the trace record that is written by the node. The Destination refers to the computer that hosts the broker on which the Trace node is deployed:
  • To write the trace record to the local system error log, select Local Error Log.

    The information that you include in the trace record is written to one of the following locations:

    • Windows platformOn Windows systems, data is written to the Event log (Application View)
    • Linux platformUNIX platformOn Linux and UNIX systems, data is written to the syslog
    • z/OS platformOn z/OS® systems, data is written to the operator console

    UNIX platformOn UNIX systems, syslog entries are restricted in length and messages are truncated by the newline character. To record a large amount of data in a log, set the destination to File or User Trace instead.

    If you select Local Error Log, indicate the number of the trace message that is to be written, and the message catalog in which the message is defined.

    • If you leave Message Catalog blank, the default message catalog is used as the source of the message that is to be written.

      You must also enter the error number of the record in Message Number. Numbers 3051 to 3099 are reserved in the default catalog for this use. The text of each of these messages in the default message catalog is identical, but if you use a different number in this range for each situation that you trace, you can identify the exact cause of the error. The default message number is 3051.

    • If you create your own message catalog, enter the fully qualified file name for your catalog in Message Catalog.

      You must also enter the appropriate number for the message in the catalog that you want to write to the local error log in Message Number. On some systems, message numbers that end 00 are reserved for system use; do not include messages with numbers such as 3100 in your message catalog.

 
       
  • To write the trace record to the system-generated user trace log, select User Trace.

    These records are written regardless of the setting of the User Trace property for the deployed message flow.

    The location of the trace logs depends on your environment:
    Windows platformWindows
    If you set the work path using the -w parameter of the mqsicreatebroker command, the location is workpath\log.
    If you have not specified the broker work path, the location is:%PROGRAMDATA%\IBM\MQSI\Common\log where %PROGRAMDATA% is the environment variable that defines the system working directory. The default directory depends on the operating system.
    Linux platformUNIX platformLinux and UNIX
    /var/mqsi/common/log
    z/OS platformz/OS
    /component_filesystem/log

    The file name is made up of the broker name, the broker UUID, and a suffix of userTrace.bin (for example, broker.e51906cb-dd00-0000-0080-b10e69a5d551.userTrace.bin.0). Use the mqsireadlog and mqsiformatlog commands before you view the user trace log.

 
       
  • To write the trace record to a file of your choice, select File.

    If you select this option, you must also set File Path to the fully qualified path name for the trace. If you do not set the path, the location of the file depends on the system; for example, on z/OS, the file is created in the home directory of the broker service ID.

    You can use any name for the trace file; for example, c:\user\trace\trace.log

    If you specify a file that does not exist already, the file is created. However, directories are not created by this process, so the full path must exist.

    The file is written as text, in the format specified by the Pattern property. You do not need to run the mqsireadlog or mqsiformatlog commands against the file.

    If a file write error occurs during processing (because of an out of space condition, for example), a single warning message, BIP4065, is written to the local system error log, and the message flow continues to process messages without logging further errors. Check the error log carefully for such a message.

  • If you do not want to write trace records, select None. You can also switch off Trace nodes.
 
File Path No Yes   The fully qualified file name of the file to which to write records. This property is valid only if Destination is set to File. filePath
Pattern No No   The data that is to be included in the trace record. Create an ESQL pattern to specify what information to write. If you write the trace record to the local error log, the pattern governs the information that is written in the text of the message number that is selected. If you use the default message catalog, and a number between 3051 and 3099, the pattern information is inserted as &1 in the message text.
  • You can write plain text, which is copied into the trace record exactly as you have entered it.
  • You can identify parts of the message to write to the trace record, specifying the full field identifiers enclosed between the characters ${ and }. To record the entire message, specify ${Root}. Other common patterns are ${LocalEnvironment} ${Environment} and ${ExceptionList}. For more information, see Viewing the logical message tree in trace output.
  • Use the ESQL functions to provide additional information; for example, use the ESQL function CURRENT_DATE to record the date, time, or both, at which the trace record is written.
The pattern shown here includes some of the options that are available. The pattern writes an initial line of text, records two elements of the current message, and adds a simple timestamp:
Message passed through with the following fields:
Store name is ${Body.storedetailselement.storename}
Total sales are ${Body.totalselement.totalsales}
Time is: ${EXTRACT(HOUR FROM CURRENT_TIMESTAMP)}
		:${EXTRACT(MINUTE FROM CURRENT_TIMESTAMP)}
The resulting trace record is:
Message passed through with the following fields:
Store name is 'SRUCorporation'
Total sales are '34.98'   
Time is: 11:19

A pattern that contains syntax errors does not prevent a message flow that contains the Trace node from deploying, but the node writes no trace records.

 
Message Catalog No No   The name of the message catalog from which the error text for the error number of the exception is extracted. The default value (blank) indicates that the message is taken from the message catalog that is supplied with IBM Integration Bus. See Creating message catalogs for more information.  
Message Number No No 3051 The error number of the message that is written.  
The Monitoring properties of the node are described in the following table.
Property M C Default Description
Events No No None Events that you have defined for the node are displayed on this tab. By default, no monitoring events are defined on any node in a message flow. Use Add, Edit, and Delete to create, change or delete monitoring events for the node; see Configuring monitoring event sources using monitoring properties for details.

You can enable and disable events that are shown here by selecting or clearing the Enabled check box.


ac04840_.htm | Last updated Friday, 21 July 2017