Merged
Size
M
Change Breakdown
Refactor60%
Maintenance30%
Testing10%
#27921refactor(core): Add structured logging to expression runtime (no-changelog)

Expression runtime gains structured logging

Console.log and console.error calls in the expression runtime are now replaced with a proper Logger interface, routing logs through n8n's centralized pipeline with level-based filtering.

The expression runtime was using raw console.* calls for observability — fine for development, but problematic in production where log filtering and centralized collection matter. Console output goes nowhere useful in a deployed environment and can't be controlled by log levels.

The @n8n/expression-runtime package now uses a structured that matches n8n-workflow's Logger shape. When the expression evaluator is instantiated, from the workflow package is passed through, routing all runtime logs into n8n's main logging pipeline.

Lifecycle events like initialization and disposal are logged at info level, while hot-path operations like expression compilation and execution use debug level. A ensures the runtime works safely even when no logger is provided.

The redundant debug boolean flag from was removed — the logger handles level filtering natively.

This work is part of ongoing expression isolation improvements, establishing the observability foundation needed for more advanced debugging and monitoring capabilities.

View Original GitHub Description

Summary

Replace all console.log/console.error calls in @n8n/expression-runtime with a proper Logger interface wired through from the workflow package's LoggerProxy.

What changed:

  • Added a Logger interface to BridgeConfig (matching n8n-workflow's Logger shape) with a no-op default
  • Replaced all console.log in IsolatedVmBridge and console.error in IsolatePool/ExpressionEvaluator with logger calls
  • Wired LoggerProxy from the workflow package into the bridge factory and evaluator config
  • Lifecycle logs (init, dispose) use info level; hot-path logs (per-evaluation) use debug level
  • Removed the now-redundant debug boolean flag from BridgeConfig — the logger handles level filtering

Related Linear tickets, Github issues, and Community forum posts

<!-- Part of expression isolation work -->

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse