Microsoft.Extensions.Logging log level configuration not working
05:43 09 Dec 2025

In appsettings.json

{
  "ApplicationInsights": {
    // https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core
    "ConnectionString": "SECRET"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Trace",
      "System": "Warning",
      "Microsoft": "Warning",
      "Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware": "None"
    },
    "ApplicationInsights": {
      // https://docs.microsoft.com/en-us/azure/azure-monitor/faq
      "IncludeScopes": true,
      "DetailedErrors": true
    },
    ...

In appsettings.Production.json:

{
  "Logging": {},
  ...

Yet ApplicationInsights is being spammed with Microsoft.EntityFrameworkCore messages.

microsoft.extensions.logging