LogEvent

data class LogEvent(val id: String = randomId(), val timestamp: Instant = timestampNow(), val host: String = hostname, val logger: String, val context: String? = threadContext(), val level: Level, val template: String? = null, val message: String, val stackTrace: String? = null, val items: EventItems = mapOf())

An event at a point in time with information about the running state of a program.

Constructors

Link copied to clipboard
constructor(id: String = randomId(), timestamp: Instant = timestampNow(), host: String = hostname, logger: String, context: String? = threadContext(), level: Level, template: String? = null, message: String, stackTrace: String? = null, items: EventItems = mapOf())

Properties

Link copied to clipboard

Name of the thread or similar context identifier where the event was emitted

Link copied to clipboard

Host where the event occurred

Link copied to clipboard
val id: String

Unique identifier for this event

Link copied to clipboard

Map of items current at the time of the event, to be displayed as structured data. If the message string was constructed from a template, there is one item per hole in the template

Link copied to clipboard

Extension property that extracts the list of items and stack trace if present in a LogEvent.

Link copied to clipboard

Severity Level of the event

Link copied to clipboard

Name of the logger that emitted the event

Link copied to clipboard

Message describing the event

Link copied to clipboard
val stackTrace: String? = null

String stack trace information that may be included if an error or exception is associated with the event

Link copied to clipboard
val template: String? = null

Message template, if any, used to construct the message

Link copied to clipboard
val timestamp: Instant

When the event occurred, to microsecond or better precision

Functions

Link copied to clipboard

Extension function that replaces values of placeholders in the message field with values of items whose keys match them.