跳转到内容
简体中文

otelLogger

此内容尚不支持你的语言。

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