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
Loggerinterface toBridgeConfig(matching n8n-workflow'sLoggershape) with a no-op default - Replaced all
console.loginIsolatedVmBridgeandconsole.errorinIsolatePool/ExpressionEvaluatorwith logger calls - Wired
LoggerProxyfrom the workflow package into the bridge factory and evaluator config - Lifecycle logs (init, dispose) use
infolevel; hot-path logs (per-evaluation) usedebuglevel - Removed the now-redundant
debugboolean flag fromBridgeConfig— 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)