【问题标题】:How to turn off Sentry in development and test environment?如何在开发和测试环境中关闭 Sentry?
【发布时间】:2021-08-30 00:32:01
【问题描述】:

我为 Rails 应用程序设置了 Sentry,但它还在 localhost 上记录错误,这是不可取的。

如何将 Sentry 配置为仅记录 production 和 staging 环境? (不是development 也不是test 环境)

我查看了ruby sentry docs 和heroku sentry addon docs,但不知道该怎么做。

【问题讨论】:

    标签: ruby-on-rails sentry


    【解决方案1】:
    # config/initializers/sentry.rb
    
    ...
    config.enabled_environments = %w[production staging]
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-09
      • 1970-01-01
      • 2021-06-12
      相关资源
      最近更新 更多