You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Why make this change?
- #3201
Two `LogLevel` bugs: Using the `None` LogLevel still emits some
`Information` messages (version, config path, etc.), and using
`"Default"` (capital D) as a key in `telemetry.log-level` config crashes
startup with `NotSupportedException`.
## What is this change?
**All logs follow the LogLevel configuration**
- Added more specific configuration for logs in the host level,
`Program.cs` which where outputing some logs that where not following
the LogLevel configuration from CLI and from configuration file.
- Add `DynamicLogLevelProvider` class which allows the loggers in the
host level to be updated after the RuntimeConfig is parsed and we know
the LogLevel.
- Add `StartupLogBuffer` class which saves the logs that are created
before we know the LogLevel, and sends them to their respective logger
after the RuntimeConfig is parsed.
**Case-insensitive `"Default"` key in config**
- `IsLoggerFilterValid` used `string.Equals` (ordinal), so `"Default"`
failed against the registered `"default"` filter.
- `GetConfiguredLogLevel` used `TryGetValue("default")`
(case-sensitive), silently ignoring `"Default"` keys.
- Both fixed with `StringComparison.OrdinalIgnoreCase` / LINQ
`FirstOrDefault`.
```json
// Now works — previously threw NotSupportedException
"telemetry": {
"log-level": {
"Default": "warning"
}
}
```
```
# Now silent — previously emitted "Information: Microsoft.DataApiBuilder ..."
dab start --LogLevel None
```
## How was this tested?
- [ ] Integration Tests
- [x] Unit Tests
- `ValidStringLogLevelFilters`: added `"Default"` (capital D) data row
to cover the case-insensitive validation fix.
## Sample Request(s)
```bash
# Suppress all output
dab start --LogLevel None
# Config key now case-insensitive
# dab-config.json:
# "telemetry": { "log-level": { "Default": "none" } }
dab start
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
Co-authored-by: Ruben Cerna <rcernaserna@microsoft.com>
Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
Co-authored-by: Anusha Kolan <anushakolan10@gmail.com>
0 commit comments