LogEntry

data class LogEntry(val timestamp: Instant, val level: LogLevel, val tag: String, val message: String, val throwable: Throwable? = null, val fields: Map<String, String> = emptyMap())

Structured log entry with metadata for multi-sink output.

Privacy (GDPR Art. 5): Log entries should not contain PII. Use field filtering before logging sensitive data.

Since

0.4.0

Constructors

Link copied to clipboard
constructor(timestamp: Instant, level: LogLevel, tag: String, message: String, throwable: Throwable? = null, fields: Map<String, String> = emptyMap())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Structured key-value fields for searchable attributes

Link copied to clipboard

Severity level of the log entry

Link copied to clipboard

Human-readable log message

Link copied to clipboard
val tag: String

Component or class identifier (e.g., "SyncEngine", "QueueRepository")

Link copied to clipboard

Optional exception associated with this entry

Link copied to clipboard

When the log entry was created (UTC)

Functions

Link copied to clipboard

Format entry as JSON for structured logging systems.

Link copied to clipboard
fun formatLine(includeTimestamp: Boolean = true, includeFields: Boolean = true): String

Format entry as a single-line string for simple output.