Aller au contenu

Structured Logging (ARCH3158)

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

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

Embedding values into a log message via string interpolation or concatenation hurts log aggregation and filtering. Values should be passed as separate structured fields.

logger.info(`user ${userId} performed ${action}`);
logger.info("user performed action", { userId, action });

Pass values as structured fields rather than embedding them in the message string.