---
title: Mule ESB Custom Connector – Log Event Fields, Message Types, and Context
description: "What the Nodinite Custom Connector for Mule ESB writes: the mandatory and optional JSON Log Event fields, Message Type naming and planning, context properties, repair and resubmit properties, exception handling with Log Status Codes, and correlation."
---

# Custom Connector: Log Event Content

The value of your Mule ESB logging depends on what each [Log Event][Log Events] carries. This page is the field reference for the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Custom Connector][]: what goes into each [JSON Log Event][], and how to set [Message Types][], context properties, status codes, and correlation so business users can find their data.

* ✅ Know which fields are mandatory and which are recommended  
* ✅ Plan Message Types before go-live; they can't be changed after logging  
* ✅ Make errors, context, and correlation searchable  

## JSON Log Event Format

The Custom Connector formats Mule messages as JSON Log Events following the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> schema. Understanding this format is critical for proper integration.

### Mandatory Fields

The following fields are **required** for every logged event:

|Field|Data Type|Description|Example Value|  
|---|---|---|---|  
|<i class="fal fa-fingerprint" aria-hidden="true"></i> **LogAgentValueId**|`number`|ID of the [Log Agent][Log Agents] sending events|`42`|  
|<i class="fal fa-tag" aria-hidden="true"></i> **EndPointName**|`string`|Name of [Endpoint][Endpoints] (transport description)|`"INT101: Receive Invoices"`|  
|<i class="fal fa-link" aria-hidden="true"></i> **EndPointUri**|`string`|URI/address of [Endpoint][Endpoints]|`"file:///drop/invoices"`|  
|<i class="fal fa-arrow-right-arrow-left" aria-hidden="true"></i> [EndPointDirection][Endpoint Directions]|`number`|Direction: `0` (receive), `1` (send)|`0`|  
|<i class="fal fa-network-wired" aria-hidden="true"></i> [EndPointTypeId][EndpointTypes]|`number`|Transport type ID|`60` (File)|  
|<i class="fal fa-envelope" aria-hidden="true"></i> **OriginalMessageTypeName**|`string`|[Message Type][Message Types] identifier|`"Invoice#1.0"`|  
|<i class="fal fa-calendar-day" aria-hidden="true"></i> **LogDateTime**|`string`|Timestamp in ISO 8601 UTC format|`"2018-05-03T13:37:00.123Z"`|  

### Optional But Recommended Fields

|Field|Data Type|Description|Example Value|  
|---|---|---|---|  
|<i class="fal fa-file-lines" aria-hidden="true"></i> **Body**|`string`|Message payload (base64-encoded if binary)|Full message content|  
|<i class="fal fa-diagram-project" aria-hidden="true"></i> **CorrelationId**|`string`|Correlation identifier for related events|GUID or business key|  
|<i class="fal fa-traffic-light" aria-hidden="true"></i> **LogStatus**|`number`|[Status code][Log Status Codes]: `-1` (error), `0` (success), `1` (info)|`0`|  
|<i class="fal fa-align-left" aria-hidden="true"></i> **LogText**|`string`|Human-readable log message|`"Invoice processed successfully"`|  
|<i class="fal fa-list" aria-hidden="true"></i> **ContextProperties**|`object`|Key-value pairs for [Context Options][]|`{"orderId": "12345", "customer": "Contoso"}`|  

See the [JSON Log Event][] documentation for the complete schema and examples.

## Message Types Configuration

<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>Message Types are mandatory and cannot be changed after logging.</strong> The <code>OriginalMessageTypeName</code> field determines which <a href="https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/">Search Field Expressions</a> are applied to extract business data from logged events.</p></div>
</aside>

### Why Message Types Matter

Many <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> features depend on well-defined [Message Types][]:

1. [Search Fields][] - Extract Order Numbers, Customer IDs, Invoice amounts, Transaction codes using [Search Field Expressions][] bound to Message Types
2. [Log Views][] - Filter and search logs by business identifiers (not just timestamps and correlation IDs)
3. [Non-Events Monitoring][] - Track message volumes, detect missing messages, alert on pattern anomalies
4. [Business Process Modeling (BPM)][BPM] - Correlate transactions end-to-end across Mule flows and other integration platforms

#### Without proper Message Types

* Search Field extraction fails - no business data in search results
* Log Views can only filter by technical metadata
* Non-Events cannot detect missing invoices, orders, or payments
* BPM cannot correlate multi-step business processes

### Naming Best Practices

Use consistent, meaningful Message Type names:

* **Include domain and version:** `Invoice#1.0`, `Order#2.0`
* **Use PascalCase:** `CustomerUpdate#1.0` (not `customer_update_v1`)
* **Version changes:** Increment version when payload schema changes significantly
* **Avoid generic names:** Use `SAPPurchaseOrder#1.0` instead of `Message#1.0`

#### Example: Setting Message Type in Mule flow

```groovy
// Set Message Type in session variable before logging
sessionVars['nodiniteMessageTypeName'] = "Invoice#1.0";
```

### Planning Message Types During Development

Message Types cannot be changed after events are logged. Plan your naming convention during development:

1. **Identify message types** in your integration flows (orders, invoices, confirmations, etc.)
2. **Define naming convention** for your organization
3. **Create Search Field Expressions** for each Message Type before go-live
4. **Document Message Types** in your integration design specifications

## Context Options and Custom Properties

[Context Options][] allow you to add custom key-value pairs to logged events for filtering, searching, and reporting.

### Common Context Properties

|Property|Purpose|Example Value|  
|---|---|---|  
|**orderId**|Business transaction identifier|`"ORD-12345"`|  
|**customerId**|Customer/partner identifier|`"CUST-98765"`|  
|**fileName**|Source file name|`"invoices_2024-11-03.xml"`|  
|**fileSize**|File size in bytes|`"524288"`|  
|**invoiceAmount**|Transaction amount|`"1250.00"`|  
|**currency**|Currency code|`"USD"`|  
|**isGDPRData**|Contains personal data flag|`"true"`|  

#### Example: Setting context properties in Groovy

```groovy
sessionVars['nodiniteContextValues'] = [
    orderId: flowVars['orderId'],
    customerId: flowVars['customerId'],
    invoiceAmount: flowVars['amount'].toString(),
    currency: "USD",
    isGDPRData: "true"
];
```

### Repair and Resubmit Properties

Use context properties to enable message repair and resubmission:

```groovy
sessionVars['nodiniteContextValues'] = [
    orderId: flowVars['orderId'],
    // Repair/resubmit metadata
    originalEndpoint: "file:///drop/invoices",
    retryCount: flowVars['retryCount'].toString(),
    canResubmit: "true",
    resubmitEndpoint: "vm://reprocess-invoice"
];
```

Build your Mule flows to handle resubmitted messages (check `retryCount`, implement idempotency, etc.).

<h2 id="exception-handling-and-error-logging">Exception Handling and Error Logging</h2>

Add the Custom Connector to exception handlers to log error conditions with appropriate [Log Status Codes][]:

```xml
<flow name="invoice-processing-flow">
    <file:inbound-endpoint path="/drop/invoices" />
    
    <!-- Normal processing ... -->
    
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <scripting:component doc:name="Set Error Logging Variables">
            <scripting:script engine="Groovy"><![CDATA[
                sessionVars['nodiniteMessageTypeName'] = "Invoice#1.0";
                sessionVars['nodiniteLogText'] = "Processing failed: " + exception.getMessage();
                sessionVars['nodiniteLogStatus'] = -1; // Error status
                sessionVars['nodiniteEndPointDirection'] = 0;
                sessionVars['nodiniteContextValues'] = [
                    fileName: flowVars['originalFilename'],
                    errorType: exception.getClass().getSimpleName(),
                    errorMessage: exception.getMessage(),
                    stackTrace: exception.getStackTrace().toString()
                ];
                return payload;
            ]]></scripting:script>
        </scripting:component>
        <flow-ref name="nodinite-logging-subflow" doc:name="Log Error"/>
    </catch-exception-strategy>
</flow>
```

### Log Status Code Guidelines

* **`-1` (Error)** - Processing failure, message rejected, exception thrown
* **`0` (Success)** - Normal processing, message accepted
* **`1` (Information)** - Audit trail, milestone reached, no action required

## Correlation

Correlation links related log events across flows, systems, and time. See the [Mule ESB Correlation][] guide for detailed correlation strategies.

### Basic correlation example

```groovy
// Set correlation ID at flow entry
sessionVars['correlationId'] = message.id; // or flowVars['orderId']
message.correlationId = sessionVars['correlationId'];

// Use same correlation ID for all log events in this flow
sessionVars['nodiniteContextValues'] = [
    correlationId: sessionVars['correlationId']
];
```

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

<i class="fal fa-list-ol" aria-hidden="true"></i> [Implement the Custom Connector][]  
<i class="fal fa-code" aria-hidden="true"></i> [Complete Working Example][Custom Connector - Complete Example]  
<i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Fields][Add or manage Search Field]  
<i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log Views][Add or manage Log View]  

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

<i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Custom Connector for Mule ESB Logging][Custom Connector]  
<i class="fal fa-code" aria-hidden="true"></i> [JSON Log Event][]  
<i class="fal fa-file" aria-hidden="true"></i> [Message Types][]  
<i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Search Field Expressions][]  
<i class="fal fa-list" aria-hidden="true"></i> [Context Options][]  
<i class="fal fa-key" aria-hidden="true"></i> [Log Status Codes][]  
<i class="fal fa-link" aria-hidden="true"></i> [Mule ESB Correlation][]  
<i class="fal fa-sitemap" aria-hidden="true"></i> [Endpoints][]  
<i class="fal fa-arrow-right-arrow-left" aria-hidden="true"></i> [Endpoint Directions][]  
<i class="fal fa-plug" aria-hidden="true"></i> [Endpoint Types][EndpointTypes]  
<i class="fal fa-user-secret" aria-hidden="true"></i> [Log Agents][]  
<i class="fal fa-stopwatch" aria-hidden="true"></i> [Non-Events Monitoring][]  
<i class="fal fa-project-diagram" aria-hidden="true"></i> [Business Process Modeling (BPM)][BPM]  

[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[BPM]:https://docs.nodinite.com/repository-model/bpms/overview/
[Context Options]:https://docs.nodinite.com/core-services/log-event/features/context-options/
[Custom Connector]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector/
[Custom Connector - Complete Example]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector-complete-example/
[Endpoint Directions]:https://docs.nodinite.com/core-services/log-event/features/endpoint-directions/
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[EndpointTypes]:https://docs.nodinite.com/core-services/log-event/features/endpoint-types/
[Implement the Custom Connector]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector-implementation/
[JSON Log Event]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/
[Log Agents]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-agent/
[Log Events]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Status Codes]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-status-code/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[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/