Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify logging behaviour in troubleshooting doc #2314

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading