Fix LogLevel: CLI phase suppression and case-insensitive "Default" config key#3203
Draft
Fix LogLevel: CLI phase suppression and case-insensitive "Default" config key#3203
Conversation
…ive Default key Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect behavior of LogLevel
Fix LogLevel: CLI phase suppression and case-insensitive "Default" config key
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
Two
LogLevelbugs:dab start --LogLevel Nonestill emits CLI-phase messages (version, config path, etc.), and using"Default"(capital D) as a key intelemetry.log-levelconfig crashes startup withNotSupportedException.What is this change?
CLI logger respects
--LogLevelCustomConsoleLoggerhad a hardcoded_minimumLogLevel = LogLevel.Information, making it ignore the--LogLevelflag entirely.LogLevelparameter toCustomLoggerProvider/CustomConsoleLogger.Program.PreParseLogLevel()— scans rawargs[]for--LogLevelbeforeCommandLine.Parserruns — so the logger factory is configured at the right level before any CLI-phase output is emitted.Utils.GetLoggerFactoryForCli(LogLevel)to wire this through.Case-insensitive
"Default"key in configIsLoggerFilterValidusedstring.Equals(ordinal), so"Default"failed against the registered"default"filter.GetConfiguredLogLevelusedTryGetValue("default")(case-sensitive), silently ignoring"Default"keys.StringComparison.OrdinalIgnoreCase/ LINQFirstOrDefault.How was this tested?
TestPreParseLogLevel(10 cases): validates pre-parse logic for all levels, numeric forms,=-syntax, and case variants.TestEngineStartUpWithVerboseAndLogLevelOptions: narrowed to Trace/Debug/Information (levels that still produce CLI output).TestEngineStartUpWithHighLogLevelOptions(new): Warning/Error/Critical/None — asserts process starts without checking stdout.ValidStringLogLevelFilters: added"Default"(capital D) data row to cover the case-insensitive validation fix.Sample Request(s)
Original prompt
This section details on the original issue you should resolve
<issue_title>[Bug]: LogLevel incorrect behavior and failing</issue_title>
<issue_description>## What?
LogLevel isn't working as expected.
Example
This is the normal DAB start output
Suppress ASPNET logging
set Logging__LogLevel__Default=NoneThis works.
Suppress DAB Logging at Command Line
dab start --LogLevel None⭐⭐ This does not work as expected.
Noneshould result in ZERO logging. Not a char, except errors.