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

Simplify log configuration variables and include docs for no-code troubleshooting #2163

Closed
stevejgordon opened this issue Aug 24, 2023 · 0 comments · Fixed by #2371
Closed
Labels
agent-dotnet enhancement New feature or request

Comments

@stevejgordon
Copy link
Contributor

stevejgordon commented Aug 24, 2023

It's currently possible to enable logging when using the no-code startup hooks by configuring the following two env vars:

  • ELASTIC_APM_PROFILER_LOG, which takes the log level to use
  • ELASTIC_APM_PROFILER_LOG_DIR, which defines where profiler logs (and potentially agent logs are written)

Due to implementation changes we have previously made, when no logger is set in AgentComponents, the profiler checks fallback logs to a file in the provided directory. This behaviour is helpful, especially for no-code scenarios, but the environment variable names are confusing. We also have ELASTIC_APM_LOG_LEVEL, which doesn't apply in the no-code case.

We should rename ELASTIC_APM_PROFILER_LOG_DIR to ELASTIC_APM_LOG_DIRECTORY and, when set, use this for all file-based logging, including startup hooks logging.

We should remove ELASTIC_APM_PROFILER_LOG and always use the more descriptive ELASTIC_APM_LOG_LEVEL variable for configuring the overall log level of all logs (agent and profiler). The profiler also listens to ELASTIC_APM_LOG_LEVEL and currently prefers the more granular of the two.

When ELASTIC_APM_LOG_DIRECTORY is set, even with another logging provider (e.g., ILogger) enabled, we should consider whether we also log to a file in this directory.

These changes will simplify troubleshooting and make gathering all relevant logs for support scenarios easier.

We should ensure all docs concerning these environment variables are updated, including ELASTIC_APM_STARTUP_HOOKS_LOGGING,

@stevejgordon stevejgordon added the enhancement New feature or request label Aug 24, 2023
@Mpdreamz Mpdreamz linked a pull request Jun 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-dotnet enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant