---
title: Enable Logging from Mule ESB with the Logger Shape and Nodinite – Step-by-Step Guide
description: Enable robust logging from Mule ESB flows using the built-in Logger shape with Nodinite. Learn how to configure, correlate, and optimize logging for seamless integration monitoring.
---

# Enable Logging using the Logger Shape

>Effortlessly log your Mule ESB messages with the built-in Logger element and unlock powerful monitoring and troubleshooting with <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>. <i class="fal fa-bolt" aria-hidden="true"></i> <i class="fal fa-search" aria-hidden="true"></i>

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>For advanced features and business value, consider using the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> Logging <a href="https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector/">Custom Connector</a> instead of the built-in Logger shape.</p></div>
</aside>

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p><strong>Set im_messageType for searchable business data</strong> - When using the Logger shape, the <code>im_messageType</code> property determines which <a href="https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/">Search Field Expressions</a> extract business data (Order Numbers, Customer IDs, Invoice amounts, Transaction codes) from your logged messages. Without proper <a href="https://docs.nodinite.com/repository-model/message-types/overview/">Message Types</a>, features like <a href="https://docs.nodinite.com/logging-and-monitoring/non-events/overview/">Non-Events Monitoring</a>, <a href="https://docs.nodinite.com/repository-model/bpms/overview/">Business Process Modeling (BPM)</a>, and business-data searches in <a href="https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/">Log Views</a> won't function. Set <code>im_messageType</code> in your Logger element configuration before deploying to production.</p></div>
</aside>

## <i class="fal fa-ballot-check" aria-hidden="true"></i> Features

* Events
  * Messages
  * Context Properties

## <i class="fal fa-edit" aria-hidden="true"></i> Configuration

In your Mule Flow, always include:

* Set Session Variable
* Logger or [Business Event][Business Events]  
![flow example][1]  
*Example Mule flow with session variable and Logger element.*  

## <i class="fal fa-link" aria-hidden="true"></i> Local Interchange ID

**runID**  
![sessionvariable][2]  
*Session variable initialization for runID in Mule ESB.*  

Review the [Mule ESB Correlation][] user guide for more information.

All events and messages in a flow (run) should use the same **local interchange id** to group related events. By using a **Session Variable** named **runID**, you ensure automatic correlation for all log entries.

Start your flow by assigning a session variable:

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

*XML example for setting runID as a Session Variable.*

### Mule Flow – Logger Element

Use the Logger element in your Mule Flow to log messages to <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>. This pattern works for both On-Prem and Cloudhub solutions.  
![Logger_Element][Logger_Element]  
*Logger element in Mule ESB flow.*  

Configure the Logger element:  
![Logger_Configuration][Logger_Configuration]  
*Logger element configuration example.*  

```xml
    <logger level="INFO" doc:name="Logger (IN)" message="im_logText=File transfer, receive message, im_messageContext=#[message], im_messageType=, im_messageBody=#[message.payloadAs(java.lang.String)], im_endPointName=FileTransfer Receive, im_endPointDirection=Receive" />
```

## <i class="fal fa-tags" aria-hidden="true"></i> Supported Properties

* <i class="fal fa-align-left" aria-hidden="true"></i> **im_logText** – Informal text, Optional  
* <i class="fal fa-tag" aria-hidden="true"></i> **im_endPointName** – The Endpoint name, Mandatory  
* <i class="fal fa-arrow-right-arrow-left" aria-hidden="true"></i> **im_endPointDirection** – The Endpoint direction, Valid values: **None**, **Unknown**, **Receive**, **Send**, **TwoWayReceive**, **TwoWaySend**  
* <i class="fal fa-network-wired" aria-hidden="true"></i> **im_endPointTypeId** – The Endpoint type id, **Integer** (see [Endpoint Types][] for valid codes), Optional  
* <i class="fal fa-link" aria-hidden="true"></i> **im_endPointUri** – The Endpoint URI, Optional (overrides the Endpoint URI set by the log agent; add \ at the end to mark as folder for local paths)  
* <i class="fal fa-envelope" aria-hidden="true"></i> **im_messageType** – The Message Type, Optional  
* <i class="fal fa-list" aria-hidden="true"></i> **im_messageContext** – The message context properties, **#[message]**, Optional  
* <i class="fal fa-list-ul" aria-hidden="true"></i> **im_messageContextCustom** – Custom message context properties, key-value pair of type <string,string> (e.g., {"transactionId":"FA0CAE5C-8968-44DF-836D-1DAA57D7831B","orderId":"1234"}), Optional  
* <i class="fal fa-file-lines" aria-hidden="true"></i> **im_messageBody** – The message payload, **#[message.payloadAs(java.lang.String)]**, Optional  
* <i class="fal fa-traffic-light" aria-hidden="true"></i> **im_logStatusCode** – The message status, **Signed integer**, Optional  
* <i class="fal fa-object-group" aria-hidden="true"></i> **im_integrationName** – The name of the [Integration][Integrations], Optional  
* <i class="fal fa-gears" aria-hidden="true"></i> **im_serviceName** – The name of the [Service][Services], Optional  
* <i class="fal fa-arrow-right-arrow-left" aria-hidden="true"></i> **im_serviceDirection** – The direction of the Service, Optional  
* <i class="fal fa-desktop" aria-hidden="true"></i> **im_serviceSystemName** – The name of the [System][Systems] used for the [Service][Services], Optional  
* <i class="fal fa-file-contract" aria-hidden="true"></i> **im_contractName** – The name of the [Contract][Contracts], Optional  
* <i class="fal fa-desktop" aria-hidden="true"></i> **im_contractSystemName** – The name of the System used for the Contract, Optional  

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> logs an event if all mandatory properties exist. It can extract the message type automatically from XML messages.

Use the log status code to highlight errors, for example, in a Mule exception handling element.

Log exception information with:  
 **#[groovy:message.getExceptionPayload().getException().getCause()]** and  
 **#[groovy:message.getExceptionPayload().getException()]**  

### EndpointTypeId

Use valid codes for the **im_endPointTypeId** property. See the list of [Endpoint Types][] for available IDs.
___

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-square-plus" aria-hidden="true"></i> [Add or manage Log Agents][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log View][]  
* <i class="fal fa-rocket" aria-hidden="true"></i> [Install Mule Log Agent][Install]  
* <i class="fal fa-edit" aria-hidden="true"></i> [Configuration][] of the agent  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

<i class="fal fa-file" aria-hidden="true"></i> [Message Types][] - Critical for [Search Field][Search Fields] extraction from Logger shape events  
<i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Search Field Expressions][] - Extract business data from logged messages  
<i class="fal fa-table-list" aria-hidden="true"></i> [Log Views][] - Search logged data by business identifiers  
<i class="fal fa-stopwatch" aria-hidden="true"></i> [Non-Events Monitoring][] - Track message volumes and patterns  
<i class="fal fa-project-diagram" aria-hidden="true"></i> [Business Process Modeling (BPM)][BPM] - End-to-end transaction correlation  
<i class="fal fa-box-archive" aria-hidden="true"></i> [Log Agents][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/FlowExample1.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/SessionVariable_Element.png

[Add or manage Log Agents]:https://docs.nodinite.com/administration/log-management/log-agents/features/add-or-manage-log-agent/
[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[BPM]:https://docs.nodinite.com/repository-model/bpms/overview/
[Business Events]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/business-events/
[Configuration]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/getting-started/configuration/
[Contracts]:https://docs.nodinite.com/getting-started/repository/contracts/overview/
[Custom Connector]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector/
[Endpoint Types]:https://docs.nodinite.com/core-services/log-event/features/endpoint-types/
[Install]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/getting-started/install/
[Integrations]:https://docs.nodinite.com/repository-model/integrations/overview/
[Log Agents]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-agent/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Logger_Configuration]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/Logger_Properties.png
[Logger_Element]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/Logger_Element.png
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Mule ESB Correlation]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/troubleshooting/how-do-i-correlate-logged-events/
[Non-Events Monitoring]:https://docs.nodinite.com/logging-and-monitoring/non-events/overview/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Services]:https://docs.nodinite.com/repository-model/services/overview/
[Systems]:https://docs.nodinite.com/repository-model/systems/overview/