【发布时间】:2016-02-29 20:04:37
【问题描述】:
我在我的 Rails 应用程序中使用 Rollbar 进行错误跟踪。出于某种原因,我从本地主机(开发中)收到错误。在 config/initializers/rollbar.rb 中:
unless Rails.env.production?
config.enabled = false
end
我还有什么需要做的吗?
完整的 rollbar.rb 文件:
Rollbar.configure do |config|
config.access_token = Figaro.env.rollbar_key
# Here we'll disable in 'test':
unless Rails.env.production?
config.enabled = false
end
end
【问题讨论】:
-
请将整个 rollbar.rb 文件与堆栈跟踪一起包含进来?
-
@JoshDeeden 查看完整的 rollbar.rb 文件的编辑。不知道你所说的stacktrace是什么意思,因为它不是一个特定的错误,而是我在rollbar中报告的所有错误(发生源于本地主机)
-
我的错误,我误解了这个问题。奇怪的。这看起来是正确的。将
config.access_token位移动到unless块时会发生什么?
标签: ruby-on-rails rollbar