A logging wrapper based on pino.
ctx.logger is a pino Logger instance and provides high-performance structured logging. In RunJS, console and window.console are proxied to ctx.logger, so console.log() or console.error() actually call the corresponding ctx.logger methods.
pino supports the following levels (high to low):
| Level | Method | Description |
|---|---|---|
fatal | ctx.logger.fatal() | Fatal error, typically causes process exit |
error | ctx.logger.error() | Error log, request or operation failed |
warn | ctx.logger.warn() | Warning, potential risk or abnormal state |
info | ctx.logger.info() | General runtime info |
debug | ctx.logger.debug() | Debug info for development |
trace | ctx.logger.trace() | Detailed tracing for diagnostics |
ctx.logger supports flexible argument ordering:
pino outputs structured JSON logs. Each log includes:
level: log level (number)time: timestamp (ms)msg: messageconsole and window.console are proxied to ctx.loggerconsole.log() equals ctx.logger.info()console.error() equals ctx.logger.error()console.warn() equals ctx.logger.warn()child() also support flexible arguments