-
Notifications
You must be signed in to change notification settings - Fork 795
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
Support wildcard or regex in minimum level override feature #1500
Comments
Why would you not have consistent casing, i.e. can you share a bit more about what your complete use case is? If you can't change it in the source, perhaps doing it as code based config (supply a lambda doing case insensitive comparison) could cover the case? |
Hello @bartelink, the main project is using several internal NuGet packages which have a different casing due to legacy. So there are packages starting with MyNameSpace and some with MYNameSpace and for both I want to set the Minimum level to information. The only solution is to add both like: "SeriLog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Default": "Warning",
"MyNameSpace": "Information",
"MYNameSpace": "Information"
}
}
} However the problem with this is that this solution cannot be used for the configuration for an Azure Function. So accepting a regex as pattern would be a good option. |
I think for this edge case, it's unlikely we'd go to the lengths required to support this feature well. Using a different scheme where |
minimum level override feature required exact case-sensitive match/startswith
Let's assume that I have my own namespaces with different casing, which need both to be logged on
Information
.I would like to use it like:
But this is not yet possible: https://github.com/serilog/serilog/blob/master/src/Serilog/Core/LevelOverrideMap.cs#L76-L77
Would it be possible to support wildcard/regex matching here?
The text was updated successfully, but these errors were encountered: