LogRecord

zio.blocks.telemetry.LogRecord
See theLogRecord companion object
final case class LogRecord(timestampNanos: Long, observedTimestampNanos: Long, severity: Severity, severityText: String, body: LogMessage, attributes: Attributes, traceIdHi: Long, traceIdLo: Long, spanId: Long, traceFlags: Byte, resource: Resource, instrumentationScope: InstrumentationScope, throwable: Option[Throwable] = ...)

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
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def hasSpanId: Boolean

Whether this log record has a span ID set.

Whether this log record has a span ID set.

Attributes

Source
LogRecord.scala
def hasTraceId: Boolean

Whether this log record has a trace ID set.

Whether this log record has a trace ID set.

Attributes

Source
LogRecord.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala