🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
LogEntry
This page was created by Hans.karlsen on 2025-09-15. Last edited by Wikiadmin on 2026-07-29.

LogEntry lets you write your own text message to the log when a Turnkey or server-side action runs. Use it to record checkpoints and values while investigating MDrivenServer or Turnkey action behavior.

Use LogEntry in an action

LogEntry is an OCL operation. Call it on the ViewModel object when you want to add a message to the log.

selfVM.LogEntry('hello I am logging here')

When this expression runs in a Turnkey action or an MDrivenServer server-side action, the text hello I am logging here is written to the log files under /logs.

Add a diagnostic message

  1. Open the action that you want to investigate in the Actions Editor.
  2. Add a LogEntry expression at the point where you need confirmation that the action has reached that step.
  3. Replace the example text with a message that identifies the operation being performed.
  4. Run the Turnkey action or MDrivenServer server-side action.
  5. Inspect the log files under /logs for the message.

For example, add a message before a section of action logic:

selfVM.LogEntry('Starting order validation')

Use messages that describe the action stage, such as Starting order validation, rather than generic messages such as here. This makes multiple log entries easier to interpret.

Where LogEntry works

Execution context Result
MDrivenServer server-side action Writes the supplied text to the log files under /logs.
Turnkey action Writes the supplied text to the log files under /logs.

Syntax

selfVM.LogEntry('message text')
Part Meaning
selfVM The ViewModel object on which the operation is called.
LogEntry The OCL operation that writes a log entry.
'message text' The string to write to the log.

For the operator definition and the original example, see Documentation:OCLOperators LogEntry.

See also