Skip to content

Make logging provider parsing robust to missing/invalid config#5546

Open
ramonsmits wants to merge 1 commit into
masterfrom
refactor-logging-providers
Open

Make logging provider parsing robust to missing/invalid config#5546
ramonsmits wants to merge 1 commit into
masterfrom
refactor-logging-providers

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Refactors LoggingSettings to parse the LoggingProviders config value into the typed Loggers flags enum instead of doing raw string Contains checks.

Notes

  • Behavior is unchanged for valid config (NLog, Seq, Otlp); now also tolerant of surrounding whitespace and casing.
  • No public API change.

…/invalid config

Replace the string `Contains` checks with parsing the `LoggingProviders` config
value into the `Loggers` flags enum.

Splitting with `RemoveEmptyEntries | TrimEntries` and parsing via `Enum.TryParse`
(ignore case, unknown values fall back to `Loggers.None`) keeps the historical
"missing/blank/unknown config -> default to NLog" behavior instead of throwing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant