#2011·serilog

Make `:lj` formatting the default/only option for message templates

Author: nblumhardtCreated Feb 8, 2024Updated Nov 4, 2025
Labelsenhancementv5

Message templates processed directly via the MessageTemplate class, and therefore by default in various sinks, use quotes around embedded string values:

csharp
Log.Information("Hello, {Name}!", "world");
// -> Hello, "world"!

This is surprising and usually not desired. Modern formatting options such as Serilog.Sinks.Console's custom output formatter, and ExpressionTemplate, do away with this:

csharp
Log.Information("Hello, {Name}!", "world");
// -> Hello, world!

Similarly, older formatters use a C#-like syntax for rendering objects - {Name = "world"}, while newer ones just produce JSON - {"Name": "world"}.

It's time to do away with the old convention and make the codebase behave consistently throughout, using the new formatting style.