Skip to content

Script logging (log)

The log scope object emits structured lines through Conduit’s tracing pipeline. This is not file I/O from Rhai — messages appear in process logs with script correlation fields.

See Host API overview for how log fits alongside txn, runtime, lookup, and metrics.

Methods

Methods: log.info(msg) · log.warn(msg)

log.info(msg)

Request + response hook · msg: string · no return

Info-level script log line (rate-limited).

log.warn(msg)

Request + response hook · msg: string · no return

Warn-level script log line (same rate limit as log.info).

Example

if txn.has_tag("debug") {
    log.info(`policy matched txn=${txn.txn_id()} pool=${txn.selected_pool()}`);
}

Pair with txn.txn_id() for correlation — see Transaction API — Introspection.