Aller au contenu
Français

otelLogger

Ce contenu n’est pas encore disponible dans votre langue.

otelLogger(options): Logger

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

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

import * as logsApi from '@opentelemetry/api-logs';
const system = ActorSystem.create('my-app',
ActorSystemOptions.create().withLogger(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