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.
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. Whentrueis passed as thevalue, the code attempts to call@structured_logging.enable = true. However, theStructuredLoggingConfigurationclass does not have anenable=method; it only definesenabled=. This will raise aNoMethodErrorwhen 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 = trueto@structured_logging.enabled = true. This aligns the setter with theenabledattribute defined in theStructuredLoggingConfigurationclass, 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 |
|
Closing in favor of more granular PRs (coming soon) |
This adds
config.rails.structured_loggingsetup that can be used to enable structured logging for common rails components:action_controlleractive_recordaction_maileractive_jobCloses #2605
Screenshots