Skip to content

Conversation

@nblumhardt
Copy link
Member

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.

@nblumhardt nblumhardt merged commit 0e316b7 into serilog:dev Nov 28, 2024
1 check passed
@nblumhardt nblumhardt mentioned this pull request Nov 28, 2024
@cchapman-kxs
Copy link

Great to see this moving forward @nblumhardt! Does this mean it is no longer behind a feature toggle and on by default? Are there any functional differences beside the one you called about property names starting with a number?

@nblumhardt
Copy link
Member Author

Hi @cchapman-kxs! Yes, the featrue toggle is gone/now always "on". The tests here show all of the behavior (enabled and changed) that I'm aware of:

https://github.com/serilog/serilog/pull/2141/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants