Wiki.js

writeLog

Writes the message to the App log. Can be used to write App variables into the log.

AI Generated

writeLog()

Purpose

Adds a custom message to the application log. This stage allows for dynamic message generation using state values, facilitating debugging and tracking of pipeline execution.


Location

src/app/services/genericStages/generic-stages.service.ts

Signature

writeLog(
  pipelineConfig: PipelineStageConfig
): OperatorFunction<StatusObject, Observable<boolean>>

Parameters

Parameter Type Description
pipelineConfig PipelineStageConfig Contains logParameters and the pushToLog function.

Command Configuration

The stage uses values from:

pipelineConfig.stageConfig.logParameters

Supported Parameters

Parameter Description
message The log message template. Supports placeholders (e.g., ${key}) replaced by values from the application state.

Example Configuration

{
  "logParameters": {
    "message": "Measurement completed for user: ${persistentValues.user_id}"
  },
  "eventTargets": {
    "onSuccess": "NEXT_STAGE"
  }
}

screenshot_2026-07-28_135400.png

Workflow

  1. Read message from logParameters.
  2. If message is empty, execute onFail.
  3. Interpolate state values into the message template using ${} syntax.
  4. Call pipelineConfig.pushToLog() with the processed message.
  5. Execute onSuccess.

Behavior