Skip to content

Commit dd03e9f

Browse files
committed
Merge pull request serilog#6 from skomis-mm/master
Read from config should not throw if MinimumLevel is not defined in settings file
2 parents be19034 + a97cd87 commit dd03e9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Dictionary<string, Dictionary<string, string>> GetMethodCalls(IConfigurationSect
9797
void ApplyMinimumLevel(LoggerConfiguration loggerConfiguration)
9898
{
9999
var minimumLevelDirective = _configuration.GetSection("MinimumLevel");
100-
if (minimumLevelDirective != null)
100+
if (minimumLevelDirective?.Value != null)
101101
{
102102
LogEventLevel minimumLevel;
103103
if (!Enum.TryParse(minimumLevelDirective.Value, out minimumLevel))

0 commit comments

Comments
 (0)