- 7 minutes to read

Context Options

Context Options are context keys with the ExtendedProperties/1.0# prefix that change how the Logging Service processes a Log Event. Add them as key/value pairs to the Context of the event. Every value is a JSON string, also for numbers and true/false: send "42", not 42.

A Log Event posted in Scalar with the Context Options LogStatus 42 and MessageTypeName FlatFileInvoice/1.0, then shown in a Log View with the overridden values, animated walkthrough (7.12)
Animated walkthrough: the Minimal Example sent with two Context Options, "ExtendedProperties/1.0#LogStatus": "42" and "ExtendedProperties/1.0#MessageTypeName": "FlatFileInvoice/1.0". The Log View shows Message Type FlatFileInvoice/1.0 and Log Status Code 42; the details keep the Original Message Type Hello.World.File/1.0, and Context Values (2) still lists both keys.

All other context properties are your own data. The ContextPropertiesFilters System Parameter removes context properties by name before they are stored, and ProtectedContextValues masks their values in Log Views.

The Message Type keys control Step 2 of the processing pipeline (Message Type determination), which decides the Search Field Expressions that are evaluated in Step 3.

Warning

From Nodinite 5.1+, context keys use the ExtendedProperties/1.0 prefix. Legacy IM.DefaultProperties/1.0 keys remain supported only for InterchangeID, ApplicationInterchangeId, LogText, MessageTypeName, MessageTypeExtractFromBody and FullFilePath; use the new format for new development.

Reference

Message and Payload

Control how the payload is processed and how the Message Type is determined.

Context Key Value Purpose Details
ExtendedProperties/1.0#MessageTypeName string Forces the Message Type name, overriding auto-detection Message Type Name
ExtendedProperties/1.0#MessageTypeExtractFromBody "true" / "false" Enables (true) or disables (false) Message Type extraction from the payload Extract from payload
ExtendedProperties/1.0#Filename
ExtendedProperties/1.0#FullFilePath
Filename / FileName / filename
originalFilename
string (file path) Default filename and folder for Resend, Repair, and Save in the Web Client File Name
ExtendedProperties/1.0#EndPointUri string (URL) Webhook URI used for Resend and Repair (ResendWebhookSettings) Webhook
ExtendedProperties/1.0#Exception string (JSON) Serialized .NET exception, in JSON format; shown as a formatted exception on the Context Values tab
ExtendedProperties/1.0#Encoding string (name or number) Character encoding of the body New 7.11 Encoding

Repository

Create and bind Repository Model entities (Integrations, Services, Systems, Contracts) from the Log Event. The structure, field tables, and examples live on Repository Binding. Available from Nodinite 4.3.0.72+, and only when the AllowRepositoryAutomapping System Parameter is enabled. The Contract keys also need UseContracts.

Context Key Value Purpose Details
ExtendedProperties/1.0#RepositoryBinding string (JSON) Creates the complete Repository structure (Service, System, Integration, relations, BPM) with one value; replaces the individual keys below Repository Binding
ExtendedProperties/1.0#IntegrationName string Integration name Individual keys
ExtendedProperties/1.0#ServiceName string Service name Individual keys
ExtendedProperties/1.0#ServiceSystemName string System of the Service Individual keys
ExtendedProperties/1.0#ServiceDirection int or string Direction of the Service Direction values
ExtendedProperties/1.0#ExternalServiceRelationName string Related Service in another System Individual keys
ExtendedProperties/1.0#ExternalServiceRelationSystemName string System of the external related Service Individual keys
ExtendedProperties/1.0#InternalServiceRelationName string Related Service in the same System Individual keys
ExtendedProperties/1.0#InternalServiceRelationDirection int or string Direction of the internal related Service Direction values
ExtendedProperties/1.0#ContractName string Contract name Individual keys
ExtendedProperties/1.0#ContractSystemName string System of the Contract (optional) Individual keys

Event Overrides

Override the default Log Event fields. The event's details show the new value; for the Message Type, the details also keep the Original Message Type.

Context Key Value Purpose Details
ExtendedProperties/1.0#LogText string Replaces the Log Text shown for the event (the LogText field) Example
ExtendedProperties/1.0#LogStatus whole number, as a string Replaces the Log Status code (the LogStatus field) New 5.3.0.40 Log Status
ExtendedProperties/1.0#LogLevel
ExtendedProperties/1.0#EventDescription
string (Information, Warning, Error, ...) Creates or updates the Log Agent's Log Status Code definition for the event's Log Status, as LogStatusCodeAutoSyncPolicy allows
ExtendedProperties/1.0#ProcessingServerName string (255) Replaces the server name, stored as the event's Processing Machine Name (the ProcessingMachineName field)
ExtendedProperties/1.0#ProcessName string (512) Replaces the process name (the ProcessName field)
ExtendedProperties/1.0#ProcessingModuleName string Replaces the module name (the ProcessingModuleName field)
ExtendedProperties/1.0#ProcessingModuleType string (512) Replaces the module type (the ProcessingModuleType field)
ExtendedProperties/1.0#ProcessingTime int (ms) Replaces the processing duration (the ProcessingTime field)
ExtendedProperties/1.0#InterchangeID string (GUID) Sets the Local Interchange Id (the LocalInterchangeId field) when the event has none
ExtendedProperties/1.0#ApplicationInterchangeId string Sets the Application Interchange Id (the ApplicationInterchangeId field) when the event has none. Without it, Nodinite tries any key that ends with ExtendedProperties/1.0#SystemInterchangeId, then x-ms-client-tracking-id.

Choosing a Value

Message Type Name

Set MessageTypeName so the right Search Fields are extracted when the Message Type can't be detected, or must not be:

  • Non-XML formats (EDI, flat files, JSON without schema) that can't be auto-detected
  • Override auto-detection based on business logic
  • Complex routing scenarios with format-specific handling

Use any unique string, for example https://nodinite.com/Customers/1.0#Batch.

Tip

Version the namespace using /1.0 or /2016/05/17 notation for uniqueness.

For example, a flat file invoice without a Message Type won't extract Search Fields. Setting ExtendedProperties/1.0#MessageTypeName to FlatFileInvoice/1.0 enables extraction of invoice numbers, customer IDs, and amounts.

Extract Message Type from Payload

If ExtendedProperties/1.0#MessageTypeName is not set, MessageTypeExtractFromBody is "true", and the event has a body, the Logging Service extracts the Message Type from the payload:

  • XML: TargetNameSpace#RootNodeName
  • JSON: Schema identifier properties
  • EDIFACT: UNH segment, formatted by EDIMessageTypeParseString

For example, for region-based routing, set MessageTypeName to Invoice-EU/1.0 and MessageTypeExtractFromBody to false to prevent the XML namespace from overriding your business logic.

File Name

The filename keys pre-set the filename and folder for Resend, Repair, and Save operations in the Web Client. The value is a valid file path (Windows path rules).

Note

Requires a body/payload to function.

Example Result
c:\temp\in\order123.txt Filename: order123.txt, Folder: c:\temp\in\
c:\temp\in\ Auto-generated filename, Folder: c:\temp\in\
c:\temp Filename: temp, Folder: c:\

When a user repairs and resubmits the message to an ActiveMQ queue, the ResubmitContextValuesForActiveMQ System Parameter selects which context properties are attached as message properties.

Webhook

EndPointUri sets the Webhook URI that Resend and Repair send the message to. The Webhook targets themselves, and whether users may edit the URI, are defined in the ResendWebhookSettings System Parameter.

Encoding

Encoding sets the character encoding of the message body for this Log Event New 7.11. Use an encoding name or numeric value from the supported encodings table, for example Windows-1252, 6, or base64:utf-8.

This value has the highest priority: it overrides an encoding named in the XML declaration of the body, the Character encoding of the Endpoint, and the Character encoding of the Message Type. The Logging Service uses it for processing and re-indexing, and the Web Client uses it as the default in View Message, in Stylesheets, and in the Search Field Wizard.

Important

A value that matches none of the supported encodings falls back to UTF-8.

Log Status

New 5.3.0.40 Override the Log Status set by Log Agents (e.g., Azure Logic Apps Logging). Send the code as a whole number in a JSON string ("42"); a JSON number (42) is refused. See the example. Whether incoming events create or update the Log Status Code definitions is set by LogStatusCodeAutoSyncPolicy.

Examples

Context Options go in the Context object of a JSON Log Event. The snippets below show the Context object only.

Set the Log Text

{"ExtendedProperties/1.0#LogText": "The node that unites different systems. Or as we call it Nodinite"}

Override the Log Status

The code goes in a JSON string; 42 without quotes is refused:

{"ExtendedProperties/1.0#LogStatus": "42"}

Override the Log Status and the Message Type

The two keys of the walkthrough at the top of this page:

{
  "ExtendedProperties/1.0#LogStatus": "42",
  "ExtendedProperties/1.0#MessageTypeName": "FlatFileInvoice/1.0"
}

Set the Encoding

{"ExtendedProperties/1.0#Encoding": "UTF-8 (with BOM)"}

Combine Keys

{
  "ExtendedProperties/1.0#MessageTypeName": "FlatFileInvoice/1.0",
  "ExtendedProperties/1.0#MessageTypeExtractFromBody": "false",
  "ExtendedProperties/1.0#Filename": "c:\\temp\\in\\order123.txt",
  "ExtendedProperties/1.0#Encoding": "Windows-1252"
}

For a complete RepositoryBinding value, see the Repository Binding examples.

Next Steps