-
Notifications
You must be signed in to change notification settings - Fork 129
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
LoggingFilterSwitch support #162
Conversation
Probably makes sense to introduce unified
and deprecate current |
I think it's better to keep 2 separate sections for Deprecating Just my 2 cents :) |
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 ! 🚀
It is probably a matter of taste but new section looks like "homemade" for me :) Deprecating something in json indeed a problem in general (JSON schema does not have spec for this, yet), but probably won't be a big problem for Serilog (considering supporting both). At the same time new section could be a good starting point and can be deprecated in the future as well (if ever). |
fair enough :) |
I see how, now that there are two Agreed it's a matter of taste; just putting one more option on the table, we could try stepping up one level of abstraction and introduce an (admittedly incomplete) declarations section (straw-man syntax): "Declare": [
{"Name": "$serverUrl", "Value": "https://some.example.com"},
{"Name": "$filterSwitch",
"Value": "Application = 'Sample'",
"Type": "Serilog.Filters.Expressions.LoggingFilterSwitch"},
{"Name": "$levelSwitch",
"Value": "Information",
"Type": "Serilog.Core.LoggingLevelSwitch"},
] Lots of hand-waving and unanswered questions in there (do we really need the |
Hi @skomis-mm @tsimbalar - just a quick update, I've spent more time now with Serilog.Filters.Expressions and think we can do better in a number of ways:
I've taken another shot at it in https://github.com/nblumhardt/serilog-expressions - it's still WIP and needs documentation, tests, and some explanations, but I hope it's a better foundation to build on. The new lib includes Also in there: .WriteTo.Console(new OutputTemplate(
"[{@t:HH:mm:ss} {@l:u3} ({SourceContext})] {@m} (first item is {Items[0]})\n{@x}")) Note Final note ... May be a few more weeks chipping away before it's really presentable, but if you have ideas/suggestions please do jump in :-) |
@nblumhardt Thanks for the heads up 👍 |
@nblumhardt @tsimbalar Great, looks promising! |
Added |
src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs
Outdated
Show resolved
Hide resolved
I think once this is in we should merge #238 👍 |
@nblumhardt I was thinking that too. The only thing confuses me #231 . Should we fix that too? |
I haven't really managed to wrap my head around #231 yet @skomis-mm - guess it might have to wait this time around :-) |
Added support for LoggingFilterSwitch from Serilog.Filters.Expressions to be used like
LoggingLevelSwitch
:FilterSwitches
config section