---
title: "O2C Demo: Log Event Structure, Correlation, and Search Fields | Nodinite"
description: "How the Nodinite Order-to-Cash demo builds each Log Event: the fields and Context Properties, the Log Agent and Endpoint settings, the Log API call, the Correlation ID format, Log Status codes, a full example, and which payload fields make good Search Fields."
---

# <i class="fal fa-file-code" aria-hidden="true"></i> O2C Demo: Log Event Structure

This page is part of the [Order-to-Cash demo][O2C Overview]. It shows how every [Log Event][Log Events] of the demo is built, how it reaches the [Log API][LogAPI], how the events of one order are correlated, and which payload fields make good [Search Fields][].

![The Log View Contoso: Orders searched on O2C - Order ID ORD-10005, the Order Received event's message body as JSON, then Show Details with its Context Values, the Application interchange id PIC-20261202-0838-0005 under Additional Field Values, and the Search Field O2C - Order ID, animated walkthrough (7.13)][1]  
*Animated walkthrough: search the **Contoso: Orders** [Log View][Log Views] on **O2C - Order ID** `ORD-10005` and open step 1, *Order Received from Customer*. **View message body** shows the Portal's order as JSON. **Show Details** › **Context Values** has the file name, order number, customer, amount, and the [Repository Binding][O2C Repository Binding]; **Additional Field Values** has the Correlation ID in **Application interchange id**, shared by every event of the order; and **Search Field Values** has **O2C - Order ID**, extracted from the body.*  

## <i class="fal fa-list" aria-hidden="true"></i> Log Event Structure in This Demo

Each Log Event follows the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [JSON formatted Log Event][] structure with:

1. **Details** (mandatory fields + optional context)
   * LogAgentValueId: `5`
   * EndPointName: Domain-specific endpoint name
   * EndPointUri: File-based path
   * EndPointDirection: `0` (receive) or `1` (send)
   * EndPointTypeId: `60` (file)
   * OriginalMessageTypeName: [Message Type][Message Types] from the [table of steps][O2C Process] for business events, `O2C.Forwarding/1.0` for forwarding events
   * LogDateTime: UTC with random increments between steps
   * SequenceNo: Position of the event within its order (1-14); EventNumber: running counter across all orders
2. **Payload** (Body)
   * Base64-encoded message content
   * Alternates between JSON, XML, and flat-file formats
   * All messages keep the same business data values
3. **Context Properties** ([Context Options][])
   * FileName: Order-specific file name
   * OrderNumber: Incrementing order number
   * `CustomerId`, `CustomerName`, `OrderAmount`: The order's customer and total; they follow the order (six customers in rotation, a product and quantity per order), see [Customers, products, and grouping][O2C Demo Customers]
   * `ExtendedProperties/1.0#RepositoryBinding`: [Repository Binding][O2C Repository Binding] for automatic landscape creation

The Correlation ID is not a Context Property; the demo stores it in `ApplicationInterchangeId`.

## <i class="fal fa-box-archive" aria-hidden="true"></i> Log Agent Configuration

* [Log Agent Value Id][Log Agent Value Id]: `5` (the [Log Agent][Log Agents] the demo logs as)
* [Endpoint Type][Endpoint Types] **Id**: `60` (file-based endpoint for the demo)
* [Endpoint Direction][Endpoint Directions]: `0` (Receive), `1` (Send)
* [Event Direction][Event Directions]: `17` for Receive events, `18` for Send events

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p><code>5</code> is also the default Log Agent for <a href="https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/overview/">Azure Logic Apps</a> logging. In an environment that already logs Logic Apps, or that other demos share, change <code>$LOG_AGENT_VALUE_ID</code> in your copy of the script to an id no other Log Agent uses, so the demo events stay separate.</p></div>
</aside>

## <i class="fal fa-cloud-arrow-down" aria-hidden="true"></i> Log API Invocation

Each interchange step is a Log Event for the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Log API][LogAPI]. The script exports the events to a file; a separate call posts them, see [Post the Exported Events to the Log API][Post Exported Events]:

* **Correlation ID**: `{PREFIX}-{DATEPART}-{HHMM}-{SEQUENCE}` in `ApplicationInterchangeId` (see [Correlation ID Format](#correlation-id-format) below)
* **Endpoint**: REST POST to `https://{host}:{port}/LogAPI/api/LogEvent`, see [Log using REST][]
* **Payload**: <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> JSON Log Event (base64-encoded body + context)

## <i class="fal fa-circle-info" aria-hidden="true"></i> Important Implementation Details

### Log Status Handling

* **Log Status 0**: Success (all completed steps)
* **Log Status -1337**: Failed/incomplete (the last **Send** event of an incomplete order; its Receive event keeps `0`)
* **Semantic meaning**: Lets you track where orders stop in the pipeline

### Correlation ID Format

* **Format**: `{PREFIX}-{DATEPART}-{HHMM}-{SEQUENCE}`, stored as `ApplicationInterchangeId`
* **Components**:
  * `{PREFIX}` = Customer code (e.g., `PIC`, Process Interchange Correlation)
  * `{DATEPART}` = Execution date in `YYYYMMDD` format (generated when the script runs)
  * `{HHMM}` = Hour and minute when the script generates the order (e.g., `0915` for 09:15)
  * `{SEQUENCE}` = Order sequence number (e.g., `0001`)
* **Example**: `PIC-20251023-0915-0001`, `PIC-20251023-0915-0042`, etc. (when executed on Oct 23, 2025 at 09:15)
* **Example**: `PIC-20251024-1430-0001`, `PIC-20251024-1430-0002`, etc. (when executed on Oct 24, 2025 at 14:30)
* **Scope**: All steps of an order share the same Correlation ID
* **Purpose**: End-to-end tracing and grouping
* **Benefit**: You can rerun the script on any date and time without code changes

<h2 id="log-event-reference"><i class="fal fa-file-code" aria-hidden="true"></i> Log Event Reference</h2>

All steps create <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> Log Events that follow the [JSON formatted Log Event][] structure:

The first Log Event of order `ORD-10001`, generated on Oct 14, 2025 at 09:15 (`Body` and the [Repository Binding][] shortened):

```json
{
  "LogAgentValueId": 5,
  "EndPointName": "Portal-OrderReceived-Drop",
  "EndPointUri": "C:\\Integration\\Portal\\Orders\\In",
  "EndPointDirection": 0,
  "EndPointTypeId": 60,
  "OriginalMessageTypeName": "O2C.Order.Received/1.0",
  "LogDateTime": "2025-10-14T06:02:15.0000000Z",
  "EventDirection": 17,
  "ProcessingUser": "Portal\\OrderService",
  "SequenceNo": 1,
  "EventNumber": 1,
  "LogText": "Order Received from Customer",
  "ApplicationInterchangeId": "PIC-20251014-0915-0001",
  "LocalInterchangeId": null,
  "LogStatus": 0,
  "ProcessName": "O2C-Order-Reception",
  "ProcessingMachineName": "portal-server-01",
  "ProcessingModuleName": "Portal.OrderService.Receiver",
  "ProcessingModuleType": "WindowsService",
  "ServiceInstanceActivityId": null,
  "ProcessingTime": 23,
  "Body": "eyJiYXRjaElkIjoiYmF0Y2gtMjAyNS0x...",
  "Context": {
    "FileName": "ORD-10001-order-received-from-customer.json",
    "OrderNumber": "ORD-10001",
    "CustomerId": "CUST-001",
    "CustomerName": "Contoso Corporation",
    "OrderAmount": "99.95",
    "ExtendedProperties/1.0#RepositoryBinding": "{...}"
  }
}
```

### Key Fields

* **OriginalMessageTypeName**: Determines the [Search Field Expressions][] (critical); forwarding events use `O2C.Forwarding/1.0`
* **ApplicationInterchangeId**: Correlation ID linking all Log Events of one order
* **SequenceNo**: Starts at `1` for each order and runs to `14` for a complete order; **EventNumber** keeps counting across all orders
* **LogStatus**: `0` (success) or `-1337` (incomplete)
* **EndPointDirection**: `0` (Receive) or `1` (Send), with **EventDirection** `17` or `18` to match
* **Body**: Base64-encoded message (JSON, XML, or flat file)
* **LogText**: Milestone name only (e.g., "Order Received from Customer"), with no order ID to avoid clutter
* **ExtendedProperties/1.0#RepositoryBinding**: Automatic landscape creation (requires [`AllowRepositoryAutomapping`][AllowRepositoryAutomapping] = `true`)

## <i class="fal fa-magnifying-glass" aria-hidden="true"></i> Search Field Extraction

The Message Type of each step decides which [Search Fields][] <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> extracts from its message. The table lists the payload fields of each message that make good Search Fields, with example values for order `ORD-10001`:

|Step|Message Type|Payload Fields to Extract|Example|
|---|---|---|---|
|1|O2C.Order.Received/1.0|orderId, customer.customerId, orderTotal, orderDate|ORD-10001|
|2|O2C.Order.Entry/1.0|OrderId, ERPReferenceNumber, EntryDate|ERP-2025-10001|
|3|O2C.Order.Confirmation/1.0|OrderId, ConfirmationId, EstimatedShipDate|CONF-2025-10001|
|4|O2C.Order.Scheduled/1.0|orderId, scheduleId, productionLines lineId|SCH-2025-10001|
|5|O2C.Order.Ready/1.0|OrderId, PackingId, TrackingNumber, Warehouse|TRK-20251016-10001|
|6|O2C.Order.Delivered/1.0|OrderId, DeliveryId, DeliveryDate, TrackingNumber|DLVY-2025-10001|
|7|O2C.Order.Invoice/1.0|orderId, invoiceId, invoiceTotal, dueDate|INV-2025-10001|

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

* <i class="fal fa-sitemap" aria-hidden="true"></i> [O2C Demo: Repository Binding][O2C Repository Binding] - The landscape metadata each Log Event carries  
* <i class="fal fa-terminal" aria-hidden="true"></i> [O2C Demo: Data Generation][O2C Data Generation] - How the script generates the events  
* <i class="fal fa-inbox" aria-hidden="true"></i> [1. Order Received from Customer][1-Order-Received] - Examine each message format in Steps 1-7  

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

* <i class="fal fa-link" aria-hidden="true"></i> [Correlate Transactions End to End][]  
* <i class="fal fa-house" aria-hidden="true"></i> [Order-to-Cash Demo Overview][O2C Overview]  
* <i class="fal fa-book" aria-hidden="true"></i> [JSON formatted Log Event][]  
* <i class="fal fa-tower-broadcast" aria-hidden="true"></i> [Log API][LogAPI]  
* <i class="fal fa-hourglass-end" aria-hidden="true"></i> [Asynchronous Logging][]  
* <i class="fal fa-file-lines" aria-hidden="true"></i> [Context Options in Log Events][Context Options]  
* <i class="fal fa-magnifying-glass" aria-hidden="true"></i> [Search Field Expressions][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/O2C_LogEventStructure.gif

[1-Order-Received]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/1-order-received/
[AllowRepositoryAutomapping]:https://docs.nodinite.com/administration/settings/system-parameters/allowrepositoryautomapping/
[Asynchronous Logging]:https://docs.nodinite.com/core-services/log-api/features/asynchronous-logging/
[Azure Logic Apps]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/overview/
[Context Options]:https://docs.nodinite.com/core-services/log-event/features/context-options/
[Correlate Transactions End to End]:https://docs.nodinite.com/getting-started/log/logging-strategy/correlate-transactions-end-to-end/
[Endpoint Directions]:https://docs.nodinite.com/core-services/log-event/features/endpoint-directions/
[Endpoint Types]:https://docs.nodinite.com/core-services/log-event/features/endpoint-types/
[Event Directions]:https://docs.nodinite.com/core-services/log-event/features/event-directions/
[JSON formatted Log Event]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/
[Log Agent Value Id]:https://docs.nodinite.com/administration/log-management/log-agents/features/add-or-manage-log-agent/#log-agent-value-id
[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 using REST]:https://docs.nodinite.com/core-services/log-api/features/log-using-rest/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[LogAPI]:https://docs.nodinite.com/core-services/log-api/overview/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[O2C Data Generation]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/o2c-data-generation/
[O2C Demo Customers]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/#fa-users-customers-products-and-grouping
[O2C Overview]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/overview/
[O2C Process]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/o2c-process-and-services/
[O2C Repository Binding]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/o2c-repository-binding/
[Post Exported Events]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/#post-the-exported-events-to-the-log-api
[Repository Binding]:https://docs.nodinite.com/core-services/log-event/features/repository-binding/
[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/