Stabilize and fully-implement dotted property names in message templates #2141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR continues on from #2063, which enables
{a.b}
-style placeholders in message templates. The major benefit of this is to support environments that have standardized on OpenTelemetry, DataDog, or ECS-style naming schemes.Dotted names, which are captured as flat property names by Serilog, are compatible with a good slice of the Serilog ecosystem, but not all of it. Enough Serilog-based sinks, libraries and tooling will work with dotted names that these should be immediately usable by a majority of users. The process of finding and fixing problems when dots appear in property names may take some time, but can proceed incrementally with this enabling work done.
There's a small behavioral change here: in message templates, property names beginning with a number must now be completely numeric, so
{0_}
and{0a}
, which were previously accepted, are now rejected. I'd expect the number of users that this might impact to be vanishingly small, but in the unlikely case someone is capturing data with these names, fallback capturing behavior will at still collect the events and properties.