Closed roelbondoc closed 1 month ago
@stympy @rabidpraxis @subzero10 thoughts on this?
Don't emit logs at all when attached to the console (this is the opposite of what Rails does by default, however — we should follow Rails conventions as closely as possible)
But the production Rails console doesn't log SQL queries, whereas the development console does, so if we want to follow Rails conventions, we could match that behavior for logging.
As for automatic instrumentation, I think we should disable that for all console sessions.
Don't emit logs at all when attached to the console (this is the opposite of what Rails does by default, however — we should follow Rails conventions as closely as possible)
But the production Rails console doesn't log SQL queries, whereas the development console does, so if we want to follow Rails conventions, we could match that behavior for logging.
As for automatic instrumentation, I think we should disable that for all console sessions.
So if we just want to keep the current behavior (but fix the 12-factor issue), we could add the explicit insights.console_enabled
option, default false
(see Roel's branch).
That way, Honeybadger.notify
and Honeybadger.event
will still report in production, and you'll see those logs in the console if that's where you're sending logs, but the automatic instrumentation will be turned off in the console.
It sounds like that's what we're leaning towards?
So if we just want to keep the current behavior (but fix the 12-factor issue), we could add the explicit
insights.console_enabled
option, defaultfalse
(see Roel's branch).That way,
Honeybadger.notify
andHoneybadger.event
will still report in production, and you'll see those logs in the console if that's where you're sending logs, but the automatic instrumentation will be turned off in the console.It sounds like that's what we're leaning towards?
Sounds good to me!
👍🏻
@roelbondoc go ahead and submit a PR for your branch when you get the chance!
Currently, the gem's behavior in
rails console
could use improvement, particularly around logging and automatic instrumentation. This affects both development and production environments.Current Behavior
HONEYBADGER_INSIGHTS_ENABLED
environment variableProblems
Current Workaround
Set
HONEYBADGER_LOGGING_TTY_LEVEL=ERROR
Potential Solutions
New Console-Specific Configuration:
HONEYBADGER_INSIGHTS_CONSOLE_ENABLED
(opt-in approach) — see theconfig-insights-console-enabled
branch for a config exampleDisable All Features in Console:
Improve Logging Control:
Questions to Consider
Related