-
Notifications
You must be signed in to change notification settings - Fork 135
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
Make additional managed + native logging improvements #1025
Conversation
…ence over the previous logging configuration key DD_TRACE_LOG_PATH and makes it clear that the developer specifies one directory to which all .NET Tracer logs will be written. This feature is backwards-compatible: 1. If DD_TRACE_LOG_PATH was not used, the managed and native log files will be written to the same default path. 2. If DD_TRACE_LOG_PATH was used (and the new DD_TRACE_LOG_DIRECTORY configuration key is not used), then the .NET Tracer will the parent directory of the input will continue to write all log files to the parent directory.
Now that I'm reviewing this PR I have a question, on Linux we work in the assumption that we have write access to |
@@ -91,7 +91,10 @@ CorProfiler::Initialize(IUnknown* cor_profiler_info_unknown) { | |||
Info("Environment variables:"); | |||
|
|||
for (auto&& env_var : env_vars_to_display) { | |||
Info(" ", env_var, "=", GetEnvironmentValue(env_var)); | |||
WSTRING env_var_value = GetEnvironmentValue(env_var); | |||
if (debug_logging_enabled || !env_var_value.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This always bothered me, especially as we add more and more settings.
We used to have a
Seems like a reasonable fallback. One concern I have is that users won't think to look there for the logs. We should make sure to update the docs and inform the Support Team about this change. Logs that can't be found are as good as no logs 😉 This will be less of an issue once we are able to include tracer logs in the Agent Flare. |
Ok, I've just saw the spdlog source, and it will throw an exception in the rotating sink .ctor, so I'll create a PR to handle that case. |
Done here: #1028 |
This is the docs PR to track logging changes: DataDog/documentation#9016 |
Makes planned improvements to the managed and native tracer logging: - Both - Adds a new `DD_TRACE_LOG_DIRECTORY` environment variable to take precedence over `DD_TRACE_LOG_PATH` - Native - Renames output file from `dotnet-profiler.log` to `dotnet-tracer-native.log` - Adds `Windows`/`Linux` to the native log output - Change the default behavior to only print out the Datadog environment variables that are set. When set to debug mode, the native logs will write all Datadog environment variables, including empty ones - Managed - Adds unit tests for dynamically setting the managed tracer's log-level One additional fix is made: Do not use the `EnvironmentHelpers` utility class in the `EnvironmentConfigurationSource` class. This creates an indirect dependency from the configuration system to the logging system.
Makes planned improvements to the managed and native tracer logging:
DD_TRACE_LOG_DIRECTORY
environment variable to take precedence overDD_TRACE_LOG_PATH
dotnet-profiler.log
todotnet-tracer-native.log
Windows
/Linux
to the native log outputOne additional fix is made: Do not use the
EnvironmentHelpers
utility class in theEnvironmentConfigurationSource
class. This creates an indirect dependency from the configuration system to the logging system.@DataDog/apm-dotnet