Ir al contenido

Structured Logging (ARCH3158)

Esta página aún no está disponible en tu idioma.

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.