---
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."
---

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

## :fa-list: Log Event Structure in This Demo

Each Log Event follows the :Nodinite: [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`.

## :fa-box-archive: 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

>[!NOTE]
>`5` is also the default Log Agent for [Azure Logic Apps][] logging. In an environment that already logs Logic Apps, or that other demos share, change `$LOG_AGENT_VALUE_ID` in your copy of the script to an id no other Log Agent uses, so the demo events stay separate.

## :fa-cloud-arrow-down: Log API Invocation

Each interchange step is a Log Event for the :Nodinite: [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**: :Nodinite: JSON Log Event (base64-encoded body + context)

## :fa-circle-info: 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

## :fa-file-code: Log Event Reference {#log-event-reference}

All steps create :Nodinite: 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`)

## :fa-magnifying-glass: Search Field Extraction

The Message Type of each step decides which [Search Fields][] :Nodinite: 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|

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

* :fa-sitemap: [O2C Demo: Repository Binding][O2C Repository Binding] - The landscape metadata each Log Event carries  
* :fa-terminal: [O2C Demo: Data Generation][O2C Data Generation] - How the script generates the events  
* :fa-inbox: [1. Order Received from Customer][1-Order-Received] - Examine each message format in Steps 1-7  

## :fa-link-horizontal: Related Topics

* :fa-link: [Correlate Transactions End to End][]  
* :fa-house: [Order-to-Cash Demo Overview][O2C Overview]  
* :fa-book: [JSON formatted Log Event][]  
* :fa-tower-broadcast: [Log API][LogAPI]  
* :fa-hourglass-end: [Asynchronous Logging][]  
* :fa-file-lines: [Context Options in Log Events][Context Options]  
* :fa-magnifying-glass: [Search Field Expressions][]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/O2C_LogEventStructure.gif

[1-Order-Received]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/1-Order-Received.md
[AllowRepositoryAutomapping]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/AllowRepositoryAutomapping.md
[Asynchronous Logging]:{ndr}/Core%20Services/Log%20API/Features/Asynchronous%20Logging.md
[Azure Logic Apps]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Overview.md
[Context Options]:{ndr}/Core%20Services/Log%20Event/Features/Context%20Options.md
[Correlate Transactions End to End]:{ndr}/Getting%20Started/2.%20Log/Logging%20Strategy/Correlate%20Transactions%20End%20to%20End.md
[Endpoint Directions]:{ndr}/Core%20Services/Log%20Event/Features/Endpoint%20Directions.md
[Endpoint Types]:{ndr}/Core%20Services/Log%20Event/Features/Endpoint%20Types.md
[Event Directions]:{ndr}/Core%20Services/Log%20Event/Features/Event%20Directions.md
[JSON formatted Log Event]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md
[Log Agent Value Id]:{ndr}/Administration/1.%20Log%20Management/3.%20Log%20Agents/Features/Add%20or%20manage%20Log%20Agent.md#log-agent-value-id
[Log Agents]:{ndr}/Administration/1.%20Log%20Management/3.%20Log%20Agents/Features/What%20is%20a%20Log%20Agent.md
[Log Events]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Log using REST]:{ndr}/Core%20Services/Log%20API/Features/Log%20using%20REST.md
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[LogAPI]:{ndr}/Core%20Services/Log%20API/Overview.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[O2C Data Generation]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Data-Generation.md
[O2C Demo Customers]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md#fa-users-customers-products-and-grouping
[O2C Overview]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Overview.md
[O2C Process]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Process-and-Services.md
[O2C Repository Binding]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Repository-Binding.md
[Post Exported Events]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md#post-the-exported-events-to-the-log-api
[Repository Binding]:{ndr}/Core%20Services/Log%20Event/Features/Repository%20Binding.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