log

open override fun log(event: LoggingEvent)(source)

The fluent-API path: forwards the built event's message, arguments, and throwable, and turns its key-value pairs into the log4k event's tags. A null key-value value is rendered as "null", since log4k tag values are non-null. Key-value pairs recorded under the OpenTelemetry code conventions become the event's SourceLocation (falling back to the MDC) and are consumed rather than kept as tags.

SLF4J hands the fluent event over verbatim, so the trailing-Throwable convention (log.atError().log("failed for {}", id, e)) must be normalized here: when no cause was set via setCause, a trailing Throwable argument is promoted to the event's throwable and trimmed from the arguments — exactly what every other delivery route does with a fluent event (Logback's event-aware logger, and SLF4J's own fallback through the classic API). Unlike the classic (String, Object) overload, the promotion applies even to a lone throwable argument, mirroring those routes. Without it, log4k would ignore the throwable as an excess formatting argument and the stack trace would be lost.