Skip to content

Commit

Permalink
Clarify logging behaviour in troubleshooting doc (#2314)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon authored Mar 26, 2024
1 parent a82dba1 commit 0faa54d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<setup-asp-net-core>> 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
Expand Down

0 comments on commit 0faa54d

Please sign in to comment.