Structured logging (ARCH1002)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
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.
Incorrect
Section titled “Incorrect”_logger.LogInformation("Order " + orderId + " processed, amount: " + amount);Correct
Section titled “Correct”_logger.LogInformation("Order {OrderId} processed, amount: {Amount}", orderId, amount);Move variables into named {Placeholder} tokens in the message template and pass them as arguments.