Different execution modes of your application can require different levels of logging. For example, in development mode, you might want to see log events from all application areas, no matter what level they are from. While in production, you probably want to see only log events with warnings and errors that are produced by your application logic, and not from the ASP.NET infrastructure. Luckily, the ASP.NET logging framework makes it very easy to configure a filter with the application settings file.
To set the minimum level of the log messages you allow, open the appsettings.json file and add the Logging element, like this:
{ ... "Logging": { "LogLevel": { "Default": "Warning" } }}
In the preceding example, we set ...