We have an app deployed in Azure App Service, and it has the below logging configuration:
If we are not using any methods in the System.Diagnostics namespace (System.Diagnostics.Trace / System.Diagnostics.TraceSource), then what is the relevance of this setting? We have noticed that the system performs poorly when the level is set to "Verbose" and the performance improves when the level is set to "Warning". However, we do not have code that uses
System.Diagnostics.Trace.TraceInformation or System.Diagnostics.Trace.WriteLine
to write a trace.
As others said, even if you do not call trace methods in your code, underlying components might do it. If tracing is enabled, and over time, it can cause memory increase and performance degradation.
You can find detailed information in this article:
As Byron Tardif mentioned in his reply, if possible, you can set the Level to error in production environment.