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

When configuring dd-trace to use a logger, the passed in logger's level is manipulated. #681

Closed
blaines opened this issue Jan 23, 2019 · 2 comments
Assignees
Labels
community Was opened by a community member core Involves Datadog core libraries
Milestone

Comments

@blaines
Copy link

blaines commented Jan 23, 2019

In the case of configuring the datadog trace client, when passing a custom logger into the datadog client the custom logger's level will be changed to WARN. This had a negative effect on our system, hiding all INFO logs. Example of our configuration:

    Datadog.configure do |c|
      c.tracer enabled: true, env: env_name, hostname: host, port: port, log: logger, debug: debug
      # etc...

Once Datadog trace is configured debug_logging= will be called here:
https://github.com/DataDog/dd-trace-rb/blob/master/lib/ddtrace/configuration.rb#L49

Because debug = false (a default) the log level for the passed in custom logger will be changed to WARN here:
https://github.com/DataDog/dd-trace-rb/blob/master/lib/ddtrace/tracer.rb#L57

My suggestion would be to keep the same behavior only if the detected logger configured is a Datadog::Logger otherwise noop. Thoughts?

@delner delner self-assigned this Jan 24, 2019
@delner delner added core Involves Datadog core libraries community Was opened by a community member labels Jan 24, 2019
@Mange
Copy link

Mange commented Feb 1, 2019

This hit us too. I had to monkey patch Rails.logger.level= to print a stack trace in production in order to find the cause of it as I couldn't reproduce it anywhere else.

@delner
Copy link
Contributor

delner commented Mar 20, 2019

This should be fixed with #721, and will roll in 0.21.0. Please let me know if this works for you!

@delner delner closed this as completed Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Was opened by a community member core Involves Datadog core libraries
Projects
None yet
Development

No branches or pull requests

3 participants