Skip to content
English

otelLogger

otelLogger(opts): Logger

Defined in: src/tracing/OtelLogsAdapter.ts:116

Build a Logger whose calls translate to OTel LogRecord.emit({...}).

import * as logsApi from '@opentelemetry/api-logs';
const system = ActorSystem.create('my-app', {
logger: otelLogger({ api: logsApi }),
});

After SDK wire-up (LoggerProvider + an OTLP-Logs exporter), every this.log.info(...) inside an actor lands as a LogRecord with the actor’s path on source, the merged MDC on attributes, and the active span’s traceId/spanId automatically linked.

OtelLoggerAdapterOptions

Logger