- 2 minutes to read

How do I correlate logged events?

Achieve seamless end-to-end tracking and business insight by correlating all logged events within a Mule ESB flow using Nodinite. This guide shows you how to unlock powerful troubleshooting and monitoring with best practices for event correlation.

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

Illustration: All log events in a Mule ESB flow share the same RunId for correlation.

To correlate multiple messages within the same Mule Flow, you must use a session variable. This approach ensures every log event in a single run is uniquely linked, enabling advanced analytics and troubleshooting.

SessionVariable_Element
Session variable element in Mule ESB

Set the session variable, typically named RunID, before the first logging point in your flow. This guarantees all subsequent log events share the same correlation ID.

SessionVariable_Flow
Session variable placement in the Mule ESB flow

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

Log using Nodinite Logging Custom Connector

When using the 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. This ensures all related events are grouped for easy tracking and analysis.

Log using Log4J

The Mule Log Agent leverages the Log4J framework to capture and forward log messages. For optimal correlation, configure Log4J within your Mule ESB flows as described here.

Next Step

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

Log Views
Configuring Log4J
Log Agents