-
Notifications
You must be signed in to change notification settings - Fork 146
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
Logging bug in development mode (5.0.0 upgrade) #447
Comments
Here is some custom initialization code this user has:
It seems like maybe the logging on 5.0.0 should be expected behavior, since by default it should log to the Rails logger that you configure. I could tell the user to just configure Honeybadger with a different logger if they don't want our output to go to their Rails logger. It might still be a good idea to investigate initialization and logging to make sure we aren't logging too early. |
But is this case logging too early? I think we're logging at the right time here: when the console starts. I think the bigger issue might be that we shouldn't be initializing at all for console sessions. (Edit: by this, I meant attaching automatic error handlers etc, which we don't, so all good.) |
Another question is whether this logging is at the right log level. This application has 171 gems including dependencies, and Honeybadger is the only one that is telling us about its initialization. Maybe this should be more like a debug level Honeybadger log message that doesn't appear by default. |
We are already using this log level but we still get the notices.
|
@joshuap I've looked into this ,and I think this is not a bug "as designed". The gem is correctly logging at initialization. But as @wlipa points out, this should maybe be a DEBUG message. There would be a lot of noise if every gem reported its initialization by default. @wlipa I was unable to reproduce your tty_level problem. The log level was respected for me. Maybe you have some other conflicting setting? |
I added logging to config/intiializers/honeybadger.rb which shows that this initializer (and therefore the Honeybadger config settings) are not getting hit until after the initial log lines appear.
I can't think of anything special we are doing regarding init order. Just normal Rails stuff. |
Oh, I see. That's the difference. I'm using the YML config file, not an initializer. The problem with using an initializer is that it runs during the initialize phase (obviously). But Honeybadger (now) initialises before that stage, for good reason—we want to catch errors in the initialize phase. To get around your issue while keeping your initializer, you can either:
I don't think there's much else we can do to get around this. I'll add a note to the docs about the catch with configuring via Ruby. |
PR to docs: https://github.com/honeybadger-io/docs/pull/222 Btw, @wlipa I think you can get around this by moving the Honeybadger initialization code into |
@joshuap what do you think of changing the log level for the init messages to DEBUG? |
Here's why we made it
It would be nice if we didn't do initialization logging (or if it was DEBUG as you suggest), so that we didn't have to worry about initialization/config priority. Regarding 2) above, I believe we do log that dev mode is active when an error is reported in dev mode, so that might be enough to get around that issue. @subzero10 @KonnorRogers — what do you think? |
I am leaning towards the DEBUG approach:
|
See #497. |
* change: change log level of init message to DEBUG Fixes #447 * Add Changelog entry * remove .tool-versions from .gitignore
Here's a 5.0.0 logging issue reported by a user:
I think this is probably because the logging happens during
Honeybadger.init!
, and we're now initializing earlier in the boot process. We may need to move logging in that case to its own method call so that we can begin logging in theafter_initialize
callback. We also need to make sure we don't change the current behavior for the other initialization plugins.Can you take a look at this @shalvah.
Front conversations
The text was updated successfully, but these errors were encountered: