Aller au contenu

Structured Logging (ARCH8158)

Ce contenu n’est pas encore disponible dans votre langue.

Key kotlin.logging.structured-logging · Severity info · Category logging

Flags string templates / concatenation inside logger calls - the message is formatted even when the level is off and the values are not structured.

logger.info("user $userId logged in from $ip")
logger.info("user {} logged in from {}", userId, ip)

Use the logger’s placeholder syntax with arguments.