namespaces

log

Emit structured log events at info, warn, and error levels.

The log namespace emits structured log events from your routes and consumers. Each call produces a structured record with the level and message, alongside the request’s trace context.

When to use

Use log to record what happened for observability: an info for normal flow, a warn for a recoverable problem, an error for a failure worth alerting on.

Operations

marreta
log.info("processing order #{order.id}")
NameSignatureSummary
log.infolog.info(message)Emits an info event.
log.warnlog.warn(message)Emits a warning event.
log.errorlog.error(message)Emits an error event.

Notes

  • An uncaught raise or fail is already logged by the runtime with its trace context, so you do not need to log before raising.