-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/serilog property filter #90
Feature/serilog property filter #90
Conversation
Pull Latest commits
src/Elastic.CommonSchema.Serilog/EcsTextFormatterConfiguration.cs
Outdated
Show resolved
Hide resolved
…Set<> to allow user's to control case-sensitivity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
jenkins test this please |
@ghayes7, I've been out on PTO and looking at this again now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of small things, then I think this is good. Thank you @ghayes7 for your effort here!
src/Elastic.CommonSchema.Serilog/EcsTextFormatterConfiguration.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Russ Cam <[email protected]>
Co-authored-by: Russ Cam <[email protected]>
…matterConfiguration with existing style.
@russcam I think I got everything. Though, github's still saying I missed a suggestion, am I blind? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for all your work on this, @ghayes7! 👍
Thanks for your contribution @ghayes7 |
This commit allows filtering of Serilog LogEvent properties from being added to EcsBase.Metadata Co-authored-by: Russ Cam <[email protected]>
Need a way to filter embedded Serilog LogEvent properties from being added to serialized / converted ECS Base.Metadata.
For example if I have embedded properties in my Serilog log event's that I used in the EcsTextFormatterConfiguration.MapCustom to enrich the ECS fields, I won't want it to be added to metadata. There's no other way to filter out a log event property, can't even remove it via EcsTextFormatterConfiguration.MapCustom because it's called after GetMetadata in LogEventConverter.ConvertToEcs. Even if the order was rearranged, still could not remove in MapCustom (i.e. LogEvent.RemovePropertyIfPresent) because the LogEvent is passed by reference so any subsequent renderings of a given logEvent, to different targets will not contain the previously removed property.
Also need a way to set the Serilog Tests LogTestBase classes Formatter property.