diff --git a/docs/troubleshooting.asciidoc b/docs/troubleshooting.asciidoc index bb00e1d4c..ba23c0943 100644 --- a/docs/troubleshooting.asciidoc +++ b/docs/troubleshooting.asciidoc @@ -39,9 +39,29 @@ The way to collect logs depends on the setup of your application. ==== ASP.NET Core If you added the agent to your application as per the <> document with the `UseAllElasticApm` or `UseElasticApm` method, it will integrate with the -https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1[ASP.NET Core logging infrastructure]. +https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging[ASP.NET Core logging infrastructure]. This means the Agent will pick up the configured logging provider and log as any other component logs. +[IMPORTANT] +-- +In this scenario, the `LogLevel` APM agent configuration (e.g. setting the `ELASTIC_APM_LOG_LEVEL` environment variable) DOES NOT control the +verbosity of the agent logs. The agent logs are controlled by the ASP.NET Core logging configuration from `IConfiguration`, typically configured +via `appsettings.json`. +-- + +For example, the following configuration in `appsettings.json` limits APM agents logs to those with a log level of `Warning` or higher: + +[source,xml] +---- +"Logging": { + "LogLevel": { + "Default": "Information", + "Elastic.Apm": "Warning" <1> + } +}, +---- +<1> Control the verbosity of the agent logs by setting the log level for the `Elastic.Apm` category + [float] [[collect-logs-classic]] ==== ASP.NET Classic