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

The logger is sometimes too noisy but not configurable #99

Closed
Ferdy89 opened this issue Mar 28, 2017 · 3 comments
Closed

The logger is sometimes too noisy but not configurable #99

Ferdy89 opened this issue Mar 28, 2017 · 3 comments
Milestone

Comments

@Ferdy89
Copy link
Contributor

Ferdy89 commented Mar 28, 2017

We currently have a big Rails app running on Heroku and using DataDog. There are a few legitimate situations under which we see the following message flooding our consoles and logs:

ERROR -- : Connection refused - connect(2) for "127.0.0.1" port 8126

Some of these situations are:

  • When compiling assets before a deployment. The Datadog buildpack won't start the agent until the application is actually ready to be started, so during asset compilation our console keeps throwing these, one every second.
  • Opening up a console. We have configured a "custom" port (the official buildpack still has an agent that listens to port 7777, so we change the port in our Datadog initializer) but that configuration only takes place after initialization. Our application is large enough so that initializing takes a few seconds, during which we see some of those errors popping up in our screen.

Just these two are enough to annoy us very much. We think a simple solution would be to just have the logger attribute on tracer.rb be an attr_writer so that it can be manually configured. We're currently just doing instance_variable_set('@logger', our_logger) to pass a Logger that outputs to a file log instead of the STDOUT.

I would be happy to send a PR if you think this is a reasonable idea. Any thoughts?

@ufoot
Copy link
Member

ufoot commented Mar 29, 2017

Hi, thanks for reporting this. Indeed, being able to override the default Logger is something which could be very useful. One thing we also consider doing is prefixing our messages when using the default logger, so that messages coming from ddtrace are clearly identified as such (currently, we find identifying them within the flow of a complete app is not convenient).

@ufoot
Copy link
Member

ufoot commented Apr 5, 2017

FYI -> #102 this should fix your issue I think, introducing a log= func to tracer.

@ufoot ufoot added this to the 0.6.1 milestone Apr 5, 2017
@ufoot
Copy link
Member

ufoot commented Apr 5, 2017

#102 merged into master, 0.6.1 about to be released.

@ufoot ufoot closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants