Function: createTracingLogger()

function createTracingLogger(tracingManager, options?): StructuredLogger;

Defined in: tracing/logging.ts:324

Create a logger that integrates with TracingManager

Parameters

Parameter Type Description
tracingManager { getCurrentSpan: () => | { spanId: string; traceId: string; } | undefined; } TracingManager instance
tracingManager.getCurrentSpan () => | { spanId: string; traceId: string; } | undefined -
options StructuredLoggerOptions Logger options

Returns

StructuredLogger

StructuredLogger that auto-correlates with traces

Example

const tracingManager = new TracingManager({ serviceName: 'my-agent' });
const logger = createTracingLogger(tracingManager);

// Logger automatically includes current trace/span IDs
logger.info('Processing request');