Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 11. Connect to an integration’s log

For each integration step, Fuse Online provides the following activity information:

  • The date and time that the step was executed
  • How long it took to execute the step
  • Whether execution was successful
  • The error message if execution was not successful

To view this information in Fuse Online, display the integration’s summary and then click the Activity tab. See also: Viewing integration activity information.

To obtain further details about integration execution, you can log information about the messages that an integration processes by adding a log step and/or a log connection to an integration.

11.1. Comparison of log steps and log connections

To log information about the messages that an integration processes, you can add one or more log steps to an integration and/or you can add one or more log connections to an integration.

A log connection cannot be an integration’s start connection. Typically, a log connection is most useful as an integration’s finish connection.

The following table indicates whether a log step or a log connection can do what you want.

To do thisAdd a log stepAdd a log connection

Log the ID of each message. (Internally, this ID is the exchange ID.)

 

Yes

Log the headers in each message.

Yes

Yes

Log the body of each message.

Yes

Yes

Log text that you specify for each message.

Yes

Yes

Specify a Camel Simple expression that Fuse Online resolves to text for each message and then sends to the log.

Yes

 

Finish an integration.

 

Yes

Log messages at the level you specify (ERROR, WARN, INFO, DEBUG, TRACE, OFF).

 

Yes

Additional resources

11.2. Add a log connection to an integration

To log information about the messages that an integration processes, add one or more log connections to the integration. A log connection takes each input message from the previous step in the integration, sends the details that you specify to the integration’s log, and passes the message to the next step in the integration.

Fuse Online provides a log connection that you can add to any number of integrations, and that you can add any number of times to the same integration. You do not need to create a log connection unless you inadvertently delete the provided log connection.

Prerequisites

  • You have chosen to add a log connection rather than a log step to an integration. For help with this, see Comparison of log step and log connection.
  • You must be creating or editing an integration. If you are creating an integration then the integration must already have its start connection.
  • Fuse Online is prompting you to choose a new integration’s finish connection or is prompting you to choose the connection that you want to add to an integration.

Procedure

  1. Click the Log connection.

    Fuse Online comes with the Log connection; you do not need to have created a log connection yourself. However, if you inadvertently deleted the provided connection and created a new log connection, then you might have given it another name.

  2. On the Choose an Action page, click Simple Logger.
  3. Accept the INFO log level, or click in the log level input box to select a different level for sending information to the log.

    Each message that an integration handles has a log level field whose value is ERROR, WARN, INFO, DEBUG, or TRACE. The table below indicates the behavior for each log level.

    Select this levelTo log information for messages with this log level

    ERROR

    ERROR

    WARN

    ERROR, WARN

    INFO

    ERROR, WARN, INFO

    DEBUG

    ERROR, WARN, INFO, DEBUG

    TRACE

    ERROR, WARN, INFO, DEBUG, TRACE

    OFF

    No logging. After creating and testing an integration, you might no longer need the logging provided by the log connection. Edit the integration, edit its log connection to select OFF, and re-publish the integration.

  4. Select one or more checkboxes to indicate what information to send to the log for each message. Choices include:

    • Message ID
    • Message headers
    • Message body

    If you do not select any checkboxes, then for each logged message, Fuse Online logs several internal IDs, how long it took to process the message, whether there was an error, and an error message if there was one. This is comparable to the information that Fuse Online provides for each integration step, which you can view in the Activity tab of the integration summary.

  5. Click Done to add the log connection to the integration.

Additional resource

11.3. Create a replacement log connection

Fuse Online provides a log connection that you can add to an integration to log information about each message that an integration processes. If you inadvertently delete the provided log connection, then you can create a new log connection from the Log connector that Fuse Online provides.

Procedure

  1. In Fuse Online, in the left navigation panel, click Connections.
  2. In the upper right, click Create Connection.
  3. Click the Log connector.
  4. In the Connection Name field, enter a name for the connection, for example, enter Log.
  5. Optionally, enter a description for this connection if you need to distinguish it.
  6. In the upper right, click Create. This displays the available connections and you can see your new log connection.