Problem Statement
We recently enabled the new Sentry logger (using config.enable_logs = true and the :logger patch) for our Rails application. We noticed that all logs are being forwarded to Sentry, regardless of the severity. We'd love to use this feature but are not interested in forwarding the massive amount of debug and info logs.
With some digging, I noticed that the patch introduced by the Sentry gem intercepts the calls to the logger and simply forwards all logs without respect for the log level. Is there any interest in adding logic to respect the log_level configured? I would be happy dive into the code.
Solution Brainstorm
By default Rails exposes a configuration option (log_level) that sets the minimum severity on the Rails.logger which is created by default. I suggest that when the gem is used within a Rails application we respect this configuration.
Problem Statement
We recently enabled the new Sentry logger (using
config.enable_logs = trueand the:loggerpatch) for our Rails application. We noticed that all logs are being forwarded to Sentry, regardless of the severity. We'd love to use this feature but are not interested in forwarding the massive amount of debug and info logs.With some digging, I noticed that the patch introduced by the Sentry gem intercepts the calls to the logger and simply forwards all logs without respect for the log level. Is there any interest in adding logic to respect the
log_levelconfigured? I would be happy dive into the code.Solution Brainstorm
By default Rails exposes a configuration option (
log_level) that sets the minimum severity on theRails.loggerwhich is created by default. I suggest that when the gem is used within a Rails application we respect this configuration.