using (_log.BeginScope("Example"))
using (_log.BeginScope(42))
using (_log.BeginScope("Process {OrderId}", 12345))
using (_log.BeginScope(new Dictionary<string, object> { ["MessageId"] = 100 }))
{
_log.LogInformation("Events in this block have additional properties attached");
}
Generates:
(Also took the chance to sneak in a quick fix for JSON formatting of NaN/Infinity values).
Matches https://github.com/serilog/serilog-extensions-logging/pull/55.
Generates:
(Also took the chance to sneak in a quick fix for JSON formatting of NaN/Infinity values).