How do I turn off the logging done by ASP.NET for each request e.g.
INFO 09:38:41 User profile is available. Using \'C:\\Users\\xxxx xxxx\\AppData\\L
Setting Logging.LogLevel in appsettings.json
for the key Microsoft
was not enough. I had to specifically set the following keys specifically, e.g.:
"Microsoft.Hosting.Lifetime": "Warning",
"Microsoft.AspNetCore.Hosting.Diagnostics": "Warning",
"Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware": "Warning"
But as an alternative using a key with a wildcard, e.g. Microsoft.*
, worked. So I ended up with:
{
"Logging": {
"LogLevel": {
"Default": "Warning",
"Microsoft.*": "Warning"
}
...
}