---
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 :Nodinite:. :fa-bolt: :fa-search:

>[!TIP]
>For advanced features and business value, consider using the :Nodinite: Logging [Custom Connector][] instead of the built-in Logger shape.

>[!IMPORTANT]
>**Set im_messageType for searchable business data** - When using the Logger shape, the `im_messageType` property determines which [Search Field Expressions][] extract business data (Order Numbers, Customer IDs, Invoice amounts, Transaction codes) from your logged messages. Without proper [Message Types][], features like [Non-Events Monitoring][], [Business Process Modeling (BPM)][BPM], and business-data searches in [Log Views][] won't function. Set `im_messageType` in your Logger element configuration before deploying to production.

## :fa-ballot-check: Features

* Events
  * Messages
  * Context Properties

## :fa-edit: 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.*  

## :fa-link: 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 :Nodinite:. 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" />
```

## :fa-tags: Supported Properties

* :fa-align-left: **im_logText** – Informal text, Optional  
* :fa-tag: **im_endPointName** – The Endpoint name, Mandatory  
* :fa-arrow-right-arrow-left: **im_endPointDirection** – The Endpoint direction, Valid values: **None**, **Unknown**, **Receive**, **Send**, **TwoWayReceive**, **TwoWaySend**  
* :fa-network-wired: **im_endPointTypeId** – The Endpoint type id, **Integer** (see [Endpoint Types][] for valid codes), Optional  
* :fa-link: **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)  
* :fa-envelope: **im_messageType** – The Message Type, Optional  
* :fa-list: **im_messageContext** – The message context properties, **#[message]**, Optional  
* :fa-list-ul: **im_messageContextCustom** – Custom message context properties, key-value pair of type <string,string> (e.g., {"transactionId":"FA0CAE5C-8968-44DF-836D-1DAA57D7831B","orderId":"1234"}), Optional  
* :fa-file-lines: **im_messageBody** – The message payload, **#[message.payloadAs(java.lang.String)]**, Optional  
* :fa-traffic-light: **im_logStatusCode** – The message status, **Signed integer**, Optional  
* :fa-object-group: **im_integrationName** – The name of the [Integration][Integrations], Optional  
* :fa-gears: **im_serviceName** – The name of the [Service][Services], Optional  
* :fa-arrow-right-arrow-left: **im_serviceDirection** – The direction of the Service, Optional  
* :fa-desktop: **im_serviceSystemName** – The name of the [System][Systems] used for the [Service][Services], Optional  
* :fa-file-contract: **im_contractName** – The name of the [Contract][Contracts], Optional  
* :fa-desktop: **im_contractSystemName** – The name of the System used for the Contract, Optional  

:Nodinite: 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.
___

## :fa-hand-point-right: Next Steps

* :fa-square-plus: [Add or manage Log Agents][]  
* :fa-hard-drive: [Add or manage Log View][]  
* :fa-rocket: [Install Mule Log Agent][Install]  
* :fa-edit: [Configuration][] of the agent  

## :fa-link-horizontal: Related Topics

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

[1]:{ndm}/Documentation%20Pictures/LogAgent/Mule/FlowExample1.png
[2]:{ndm}/Documentation%20Pictures/LogAgent/Mule/SessionVariable_Element.png

[Add or manage Log Agents]:{ndr}/Administration/1.%20Log%20Management/3.%20Log%20Agents/Features/Add%20or%20manage%20Log%20Agent.md
[Add or manage Log View]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Add%20or%20Manage%20Log%20View.md
[BPM]:{ndr}/Repository%20Model/BPMs/Overview.md
[Business Events]:{ndr}/Logging%20and%20Monitoring/MuleSoft%20-%20AnyPoint%20Platform%20-%20Logging/Features/Business%20Events.md
[Configuration]:{ndr}/Logging%20and%20Monitoring/MuleSoft%20-%20AnyPoint%20Platform%20-%20Logging/Getting%20started/3.%20Configuration.md
[Contracts]:{ndr}/Getting%20Started/4.%20Repository/Contracts/Overview.md
[Custom Connector]:{ndr}/Logging%20and%20Monitoring/MuleSoft%20-%20AnyPoint%20Platform%20-%20Logging/Features/Custom%20Connector.md
[Endpoint Types]:{ndr}/Core%20Services/Log%20Event/Features/Endpoint%20Types.md
[Install]:{ndr}/Logging%20and%20Monitoring/MuleSoft%20-%20AnyPoint%20Platform%20-%20Logging/Getting%20started/2.%20Install.md
[Integrations]:{ndr}/Repository%20Model/Integrations/Overview.md
[Log Agents]:{ndr}/Administration/1.%20Log%20Management/3.%20Log%20Agents/Features/What%20is%20a%20Log%20Agent.md
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Logger_Configuration]:{ndm}/Documentation%20Pictures/LogAgent/Mule/Logger_Properties.png
[Logger_Element]:{ndm}/Documentation%20Pictures/LogAgent/Mule/Logger_Element.png
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[Mule ESB Correlation]:{ndr}/Logging%20and%20Monitoring/MuleSoft%20-%20AnyPoint%20Platform%20-%20Logging/Troubleshooting/How%20do%20I%20correlate%20logged%20events.md
[Non-Events Monitoring]:{ndr}/Logging%20and%20Monitoring/Non-Events/Overview.md
[Search Field Expressions]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Overview.md
[Search Fields]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/What%20is%20a%20Search%20Field.md
[Services]:{ndr}/Repository%20Model/Services/Overview.md
[Systems]:{ndr}/Repository%20Model/Systems/Overview.md