NormalizedLogEvent

data class NormalizedLogEvent(val level: LogLevel, val loggerName: String, val message: String?, val attributes: Map<String, String> = emptyMap(), val activeTrace: ActiveTrace? = null, val resolvedAttributes: Map<String, String>? = null, val emittedEpochNanos: Long? = null)

A log event normalized to a platform-independent shape.

Each per-platform capture edge translates the platform's native log event into this common form before handing it to LogCapture. The edge is the only thing that differs across platforms; everything downstream of this type is shared common code.

Constructors

Link copied to clipboard
constructor(level: LogLevel, loggerName: String, message: String?, attributes: Map<String, String> = emptyMap(), activeTrace: ActiveTrace? = null, resolvedAttributes: Map<String, String>? = null, emittedEpochNanos: Long? = null)

Properties

Link copied to clipboard

The distributed-trace context resolved at the synchronous capture edge, on the caller that logged — never on the drain coroutine (#1034). The edge fills this by calling LogCapture.resolveAtEdge while it still sees the caller's ambient context; LogCapture.capture then feeds the sampling gate from this snapshot instead of re-consulting the provider off-thread.

Link copied to clipboard

Structured key/value pairs attached to the event (the MDC-equivalent payload). Mapped onto the resulting LogRecord's attributes by CaptureConfig.attributeMapper.

Link copied to clipboard

The epoch-nanosecond instant the line was logged, read at the synchronous capture edge on the caller — never on the drain coroutine (#1993). This is OTLP's timeUnixNano: when the event occurred. LogCapture.capture copies it to LogRecord.timestampEpochNanos and keeps its own drain-side reading for LogRecord.observedEpochNanos, which is observedTimeUnixNano: when capture saw it. Read on the drain, the two collapse into one number and every record carries flush cadence instead of event timing.

Link copied to clipboard

The event's level.

Link copied to clipboard

The originating logger's name (e.g. a fully-qualified class name).

Link copied to clipboard

The log message body, or null if the event carried no message.

Link copied to clipboard

The LogRecord attributes produced by CaptureConfig.attributeMapper, applied at the synchronous capture edge on the caller that logged — never on the drain coroutine (#1630). A queueing edge fills this by calling LogCapture.resolveAtEdge while the caller's ambient state is still the state the line was emitted under; LogCapture.capture then uses the snapshot instead of re-running the mapper off-thread.