You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rails structured logging automatically turns Rails ActiveRecord and ActionController events into Sentry logs. That makes it automatic logging instrumentation, so starting with sentry-rails 7.1.0 it will be off by default, like the rest of logs and metrics. The interpretation behind that behavior was that adding sentry-rails counted as the logging opt-in, analogous to adding a dedicated logging integration. But in that case it was too ambiguous; this is a corrective follow-up.
We're sorry for the disruption of changing a default within 7.x. We chose to make the change now instead of waiting for 8.0, so that everyone adopting logs gets the same, predictable behavior from the start.
Make Rails structured logging opt-in
Users who want Rails structured logs should enable them explicitly:
Before 7.0, config.rails.structured_logging.enabled followed the global enable_logs option. feat!: Remove enable_logs #3053 removed enable_logs in 7.0 and set the Rails default to true.
7.1.0 makes it opt-in: an unset option means off, and sentry-rails logs a warning at boot until the option is set explicitly. Both the warning and the "unset" state are removed in 8.0.
Sentry.logger.* stays available regardless of this setting. No global enable_logs gate and no double opt-in.
SDK (sentry-rails 7.1.0)
Default structured_logging.enabled to true or nil (unset), treated as off
Rails structured logging automatically turns Rails ActiveRecord and ActionController events into Sentry logs. That makes it automatic logging instrumentation, so starting with sentry-rails 7.1.0 it will be off by default, like the rest of logs and metrics. The interpretation behind that behavior was that adding
sentry-railscounted as the logging opt-in, analogous to adding a dedicated logging integration. But in that case it was too ambiguous; this is a corrective follow-up.We're sorry for the disruption of changing a default within 7.x. We chose to make the change now instead of waiting for 8.0, so that everyone adopting logs gets the same, predictable behavior from the start.
Make Rails structured logging opt-in
Users who want Rails structured logs should enable them explicitly:
Implementation notes
Background
config.rails.structured_logging.enabledfollowed the globalenable_logsoption. feat!: Remove enable_logs #3053 removedenable_logsin 7.0 and set the Rails default totrue.Sentry.logger.*stays available regardless of this setting. No globalenable_logsgate and no double opt-in.SDK (sentry-rails 7.1.0)
structured_logging.enabledtotrueornil(unset), treated as offDocs (sentry-docs, released with 7.1.0)
platform-includes/getting-started-config/ruby.rails.mdx): addconfig.rails.structured_logging.enabled = trueplatform-includes/logs/setup/ruby.rails.mdx): opt-in wording and snippetplatform-includes/logs/options/ruby.rails.mdx): opt-in wording, enable/disable sectionsdocs/platforms/ruby/guides/rails/logs/index.mdx): troubleshooting and requirements ("opt-in since 7.1.0")Release and follow-up
post_install_message