LogEvent

data class LogEvent(val level: LogLevel, val loggerName: String, val message: String?, val throwable: Throwable?, val attributes: Map<String, Any?>, val context: LogContext, val thread: String, val timestamp: Long)(source)

Represents a single log event captured at a point in time.

A LogEvent is an immutable snapshot assembled by DefaultLogger and passed through the LogPipeline to each configured dev.shivathapaa.logger.sink.LogSink. Sinks and formatters should treat all fields as read-only.

Constructors

Link copied to clipboard
constructor(level: LogLevel, loggerName: String, message: String?, throwable: Throwable?, attributes: Map<String, Any?>, context: LogContext, thread: String, timestamp: Long)

Properties

Link copied to clipboard

Structured key-value pairs attached at the call site via the AttrBuilder DSL.

Link copied to clipboard

The ambient LogContext active at the time the event was created.

Link copied to clipboard

The severity level of the event.

Link copied to clipboard

The name of the logger that created the event, used as the tag in formatted output.

Link copied to clipboard

The log message. May be null if only structured attributes were provided.

Link copied to clipboard

The name of the thread on which the event was created.

Link copied to clipboard

An optional exception associated with the event.

Link copied to clipboard

The wall-clock time at which the event was created, as milliseconds since the Unix epoch.