Zum Inhalt springen

Structured Logging (ARCH4158)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key java.logging.structured-logging · Severity warning · Category logging

Building log messages with string concatenation hurts log aggregation and forces the string to be constructed even when the level is disabled. Use parameterized {} templates instead.

log.info("User " + userId + " created order " + orderId);
log.info("User {} created order {}", userId, orderId);

Write parameterized message templates using SLF4J’s {} placeholders instead of string concatenation.