Represents an immutable log record with trace correlation support.
A LogRecord contains a log message, its severity level, timing information, and optional trace context for distributed tracing correlation. Trace fields use primitive sentinel values (0 = absent) instead of Option wrappers for zero allocation on the logging hot path.
Value parameters
- attributes
-
Additional attributes/metadata associated with the log record
- body
-
The log message body
- instrumentationScope
-
The instrumentation scope (library/tool) that generated this log record
- observedTimestampNanos
-
The time when the event was observed/recorded, in nanoseconds since Unix epoch
- resource
-
The resource that generated this log record
- severity
-
The severity level of the log record
- severityText
-
The text representation of the severity level
- spanId
-
Span ID as Long (0 means absent)
- throwable
-
Optional throwable whose stack trace is deferred to export time
- timestampNanos
-
The time when the event occurred, in nanoseconds since Unix epoch
- traceFlags
-
Trace flags as Byte (0 means none/absent)
- traceIdHi
-
High 64 bits of trace ID (0 with traceIdLo == 0 means absent)
- traceIdLo
-
Low 64 bits of trace ID (0 with traceIdHi == 0 means absent)
Attributes
- Companion
- object
- Source
- LogRecord.scala
- Graph
-
- Supertypes