A filtering rule decides whether a log message is written by comparing its severity with rules for the logger category and provider. This reduces production noise while preserving detailed local debugging output. section 26.4
A logging configuration can define several rules:
- Set a default minimum level, such as Information. section 26.4
- Raise the minimum for categories beginning with Microsoft, such as Warning, to suppress framework noise. section 26.4
- Apply a provider-specific threshold, such as Error for console output; lower-level messages may still reach another provider. section 26.4
Provider-specific configuration
In appsettings.json, a default rule can use Debug, while the console provider keeps Microsoft messages at Warning and a file provider uses Information. For each provider, the most specific matching rule wins.
