C# Serilog: how to log with String interpolation and keep argument names in message templates?
问题 How to replace this code: string name = "John"; logger.Information("length of name '{name}' is {nameLength}", name, name.Length); with C# String interpolation like this or similar string name = "John"; // :-( lost benefit of structured logging: property names not passed to logger logger.Information($"length of name '{name}' is {name.Length}"); but keep the property names for structured logging to work? Benefits would be: Increased readability You'll never forget an argument in arguments list