-
-
Notifications
You must be signed in to change notification settings - Fork 515
Support for ActiveSupport log subscribers #2676
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
base: master
Are you sure you want to change the base?
Support for ActiveSupport log subscribers #2676
Conversation
016b4ad
to
b1bae5d
Compare
0523e66
to
7814451
Compare
c8f3822
to
cc39c9c
Compare
@structured_logging.enabled = false | ||
when StructuredLoggingConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: A typo in the structured_logging=
setter (.enable
instead of .enabled
) causes a NoMethodError
, crashing the application when enabling the feature.
-
Description: The
structured_logging=
setter method contains a typo. Whentrue
is passed as thevalue
, the code attempts to call@structured_logging.enable = true
. However, theStructuredLoggingConfiguration
class does not have anenable=
method; it only definesenabled=
. This will raise aNoMethodError
when a user attempts to enable the feature withconfig.rails.structured_logging = true
, causing the application to crash during its initialization phase. The configuration works as expected when set tofalse
. -
Suggested fix: In the
structured_logging=
method, change the line@structured_logging.enable = true
to@structured_logging.enabled = true
. This aligns the setter with theenabled
attribute defined in theStructuredLoggingConfiguration
class, resolving theNoMethodError
.
severity: 0.95, confidence: 1.0
Did we get this right? 👍 / 👎 to inform future reviews.
93903de
to
98226ec
Compare
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Support for ActiveSupport log subscribers ([#2676](https://github.com/getsentry/sentry-ruby/pull/2676)) If none of the above apply, you can opt out of this check by adding |
end | ||
|
||
if RUBY_VERSION >= "3.5" | ||
if ruby_version >= Gem::Version.new("2.5") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds
config.rails.structured_logging
setup that can be used to enable structured logging for common rails components:action_controller
active_record
action_mailer
active_job
Closes #2605
Screenshots