LogSpan
classin packageklyn.logging
public final class LogSpan implements AutoClosable:
LogSpan
All Implemented Interfaces: AutoClosable

Timed observability scope associated with a logger.

A span records monotonic duration, trace/span identifiers and its optional parent. Closing it emits one DEBUG event containing durationMs.

Example
import klyn.logging

logger = LogManager.getLogger("customers")
try span = logger.span("Load customer", customerId = 42):
pass
Properties
Modifier and Type Member Description
public readonly property closed
closed as Boolean:
Whether this span has ended.
public readonly property durationMs
durationMs as Double:
Elapsed duration in milliseconds.
public readonly property endTime
endTime as Timestamp:
Wall-clock end instant, or null while active.
public readonly property name
name as String
Span name.
public readonly property parentSpan
parentSpan as LogSpan
Parent span, or null for a trace root.
public readonly property spanId
spanId as String
Unique span identifier.
public readonly property startTime
startTime as Timestamp
Wall-clock start instant.
public readonly property traceId
traceId as String
Trace identifier shared with descendants.
Methods
Modifier and Type Member Description
public close
close() as Void:
Ends and logs this span once.
Inherited Methods
methodInherited Methods from AutoClosable: close