I was trying to determine why my asp.net core application as so slow during startup (F5 w/debugging). I believe I found one of the reasons. By default, a new asp.net core application has an appsettings.Development.json file. Within this file there are several settings to set the default log level. Typically, you will see something like the following
{
"Logging":
{
"LogLevel":
{
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
Keep in mind the order of settings are as follows going from very verbose to turned off.
- Trace (Very Verbose)
- Debug
- Information
- Warning
- Error
- Critical
- None
I found that setting my development log settings to anything above Warning improved startup up time significantly!
After I figured out above I did come across a Rick Strahl post. If you don’t follow Rick do.