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

Option to hide initialization message in the log #296

Closed
pomartel opened this issue Sep 18, 2018 · 6 comments
Closed

Option to hide initialization message in the log #296

pomartel opened this issue Sep 18, 2018 · 6 comments

Comments

@pomartel
Copy link
Contributor

pomartel commented Sep 18, 2018

Every time I run a rake command, make a new deployment or open a console in Heroku, this log line appears:

** [Honeybadger] Initializing Honeybadger Error Tracker for Ruby. Ship it! version=4.0.0 framework=rails level=1 pid=4

I find it a bit annoying, no other gems or plugins does that by default. Would it be possible to add an option to remove it from the log?
https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/config.rb#L58

@joshuap
Copy link
Member

joshuap commented Sep 18, 2018

@pomartel have you considered changing the logging.level option to 'WARN'? That would silence startup and successful error report report notifications. You'd still be notified of warnings/errors. https://docs.honeybadger.io/ruby/gem-reference/configuration.html#configuration-options

@pomartel
Copy link
Contributor Author

I've put the following in my config/honeybadger.yml file:

logging:
  level: "WARN"

When I boot my rails server (puma), it still shows up:

[31738] Puma starting in cluster mode...
[31738] * Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
[31738] * Min threads: 1, max threads: 1
[31738] * Environment: development
[31738] * Process workers: 1
[31738] * Preloading application
** [Honeybadger] Initializing Honeybadger Error Tracker for Ruby. Ship it! version=4.0.0 framework=rails level=1 pid=31738
** [Honeybadger] Development mode is enabled. Data will not be reported until you deploy your app. level=2 pid=31738
[31738] * Listening on tcp://0.0.0.0:5000

Is the config file read after that line is outputted in the log? Or am I doing something wrong?

@joshuap
Copy link
Member

joshuap commented Sep 18, 2018

The config file should be read before any log output is created. @minhajuddin can you take a look at this when you have the time? The issue might be that we log to the rails logger by default. I thought we still respected our internal log level, but maybe we don't in that case?

@pdobb
Copy link
Contributor

pdobb commented Feb 27, 2019

Same results for me ^. Here's what my cron log looks like :/

image

@joshuap
Copy link
Member

joshuap commented Mar 1, 2019

I confirmed what you all are seeing -- when using the Rails logger (which is the default), our internal log level is ignored in favor of Rails' log level. I forgot that we also mention this in our docs (see the "logging" heading here).

I'll think about a possible fix for this. In the meantime, an option that would work would be to use a custom honeybadger.log file (or stdout) by setting logging.path in addition to logging.level.

@pdobb
Copy link
Contributor

pdobb commented Mar 1, 2019

@joshuap Thank you for pointing out the docs section. That works well enough for my needs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants