Search code examples
ruby-on-railssentry

How to turn off Sentry in development and test environment?


I set up Sentry for a rails app, but it also logs errors on localhost, which is undesirable.

How can I configure Sentry to only log the production and staging environments? (not development nor test environments)

I looked at the ruby sentry docs, and the heroku sentry addon docs but couldn't see how to do this.


Solution

  • # config/initializers/sentry.rb
    
    ...
    config.enabled_environments = %w[production staging]
    ...