serilog / serilog-settings-configuration

A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Apache License 2.0
456 stars 129 forks source link

Serilog Crashed if we set Minimum log level to DEBUG(All Caps) #305

Closed ganesh-darandale closed 2 years ago

ganesh-darandale commented 2 years ago

Description Serilog Crashed if we set Minimum log level to DEBUG(All Caps)

Reproduction "Serilog": { "MinimumLevel": { "Default": "DEBUG",

Expected behavior No exception should throw if we provide sme log level in Cpas

Relevant package, tooling and runtime versions What Serilog version are you using, on what platform?

Additional context Exp -> The value DEBUG is not a valid Serilog level.

Stack -> at Serilog.Settings.Configuration.ConfigurationReader.ParseLogEventLevel(String value) at Serilog.Settings.Configuration.ConfigurationReader.g__ApplyMinimumLevel|9_1(IConfigurationSection directive, Action`2 applyConfigAction, <>c__DisplayClass9_0& ) at Serilog.Settings.Configuration.ConfigurationReader.ApplyMinimumLevel(LoggerConfiguration loggerConfiguration) at Serilog.Settings.Configuration.ConfigurationReader.Configure(LoggerConfiguration loggerConfiguration) at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings) at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, String sectionName, DependencyContext dependencyContext) at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, DependencyContext dependencyContext)