Provider-specific configuration and filters

Each logging provider can be configured independently. For example, if you wish to enable all logs in the Debug output, but want to filter the Console output to only display Warning and above, here is how you can configure it in the appsettings.json file:

{  ...  "Logging": {    "Debug": {      "LogLevel": {        "Default": "Information"      }    },    "Console": {      "LogLevel": {        "Default": "Warning"      }    },    "LogLevel": {      "Default": "Debug",      "Microsoft.AspNetCore": "Warning"    }  } }

The Console and Debug providers are helpful when running locally, but in production, you need a more powerful provider that can also store the logs that are coming from all of your services (and their instances) in a centralized way to allow querying ...

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.