Ir al contenido

Structured logging (ARCH1002)

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

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

Logs built with string interpolation or concatenation do not produce searchable fields. Use structured logging with named placeholders.

_logger.LogInformation("Order " + orderId + " processed, amount: " + amount);
_logger.LogInformation("Order {OrderId} processed, amount: {Amount}", orderId, amount);

Move variables into named {Placeholder} tokens in the message template and pass them as arguments.