Skip to content
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

MinimumLevel Override configuration section case-sensitivity #386

Closed
GuillaumeBau opened this issue Jun 29, 2023 · 0 comments · Fixed by #388
Closed

MinimumLevel Override configuration section case-sensitivity #386

GuillaumeBau opened this issue Jun 29, 2023 · 0 comments · Fixed by #388

Comments

@GuillaumeBau
Copy link

Hello,

In the section MinimumLevel:Override, the log level detection are case-sensitive :

https://github.com/serilog/serilog-settings-configuration/blob/e8783352aff2f46b52d41c4232621c9d4b9ee2d7/src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs#L167C13-L167C76

In contrario, the log level parsing do by the function ParseLogEventLevel is case-insensitive :

https://github.com/serilog/serilog-settings-configuration/blob/d7e0dbd7239df3b230a0dd330fefbe19bb6818bf/src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs#L595C9-L595C84

Could you render the log level detection do in ApplyMinimumLevel case-insensitive ? This will prevent the following error occuring :

System.InvalidOperationException: 'No LoggingLevelSwitch has been declared with name "verbose". You might be missing a section "LevelSwitches":{"verbose":"InitialLevel"}'

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant