- 1 minutes to read

How do I correlate logged events?

This guide teaches how to provide vital information that enables correlation for all logged events within one run through a Mule ESB flow.

graph LR subgraph "Mule ESB Flow - Correlation" ro[Init Session Variable
RunId=123] --> |Do stuff|roE1(fal:fa-bolt Log Event
RunId=123) roE1 -->|Do stuff|roE2(fal:fa-bolt Log Event
RunId=123) roE1 -->|Do stuff|roE3(fal:fa-bolt Log Event
RunId=123) end

To be able to correlate on several messages within the same Mule Flow, a session variable is required.

SessionVariable_Element

The session variable is named RunID and is placed before the first logging point.

SessionVariable_Flow

<set-session-variable variableName="runID" value="#[java.util.UUID.randomUUID().toString()]" doc:name="Session Variable"/>

Log using Nodinite Logging Custom Connector

Provide the session variable RunID as the local interchange id property when calling the Log sub flow with the Mule ESB - Custom Connector.

Log using Log4J

The Mule Log Agent uses the Log4J framework to log messages. Configuration of Log4J within the Mule ESB flows is further described here.

Next Step

Add or manage Log Agents
Configuration of the agent
Install Mule Log Agent

Log Views
Configuring Log4J
Log Agents