Octov0.4.2
ReferenceConnectors

Logger

Structured logging: the logger connector and log block.

The logger connector owns a configured structured logger (Go slog) — output, format, and level — and the log block writes a line per message through it, passing the message through unchanged.

logger connector

The connector owns its output: when output names a file, the file is opened on start (created or appended, mode 0600) and closed on shutdown. Every setting has a sensible default, so a logger connector can be declared with no settings at all.

Provides a source: no — it is a service connector. Blocks that bind to it: log.

Settings

SettingTypeRequiredDefaultDescription
outputstringNostdoutstdout, stderr, or a file path.
formatenum: text | jsonNotextLog output format.
levelenum: debug | info | warn | errorNoinfoMinimum log level.
addSourcebooleanNofalseInclude source file:line in log records.

In the Kubernetes module, output is additionally teed to the runtime's central log sink so it reaches the log aggregator.

log block

Log — a wire-tap that logs the message and passes it through unchanged. The logged line is a CEL expression evaluated against the message; with no expression, a JSON object with the body and variables is logged. Every record carries the message's event_id as a structured attribute.

SettingTypeRequiredDefaultDescription
messageexpressionNoJSON {body, vars}CEL expression to log. Defaults to the JSON body (and variables).
levelenum: debug | info | warn | errorNoinfoLog level.
loggerstringNoprocess default loggerOptional named logger connector to write to.
fullbooleanNofalseAttach the whole message (correlation ID, variables, body, schema) as structured log attributes.

With no logger set, the block writes through the process default logger. With full: true and no message expression, the line is the fixed label message — the whole message is already attached as structured attributes.

Example

From samples/file-logger.yaml — a named logger connector writing JSON to a file:

service:
  name: file-logger-demo

connectors:
  - name: ticker
    type: cron
  # A named logger connector. It owns its output file (opened on start, closed
  # on shutdown). Any settings can be omitted to take the defaults
  # (output: stdout, format: text, level: info).
  - name: audit
    type: logger
    settings:
      output: /tmp/octo-audit.log
      format: json
      level: info
      addSource: false

flows:
  - name: audit-ticks
    source:
      connector: ticker
      type: cron
      settings:
        schedule: "@every 2s"
        payload: '{"date": string(now)}'
    process:
      # This log block writes through the named "audit" logger connector.
      - type: log
        settings:
          logger: audit
          message: '"tick at " + body.date'

Use full: true with a JSON-format logger while developing to dump the entire message — event ID, correlation ID, variables, and body — at any point in a flow.

On this page