Closed
Description
Currently, BeginScope()
will cause any properties on the state
object to be attached to resulting events:
and:
However, it's also possible to use string "names" with scopes, and in that case some form of scope path should be attached to the event. For example:
using (log.BeginScope("A"))
{
using (log.BeginScope("B")
{
log.LogInformation("Hello");
}
}
produces a scope like "A -> B"
in the default console logger output.
Serilog might attach these as a Sequence
property, e.g. (in JSON rendering) "Scope": ["A", "B"]
.