sentry-ruby: Raven Ruby not sending errors.
I have the following configuration:
# config/initializers/raven.rb
require 'raven'
logger = ::Logger.new("log/raven.log")
logger.level = ::Logger::DEBUG
Raven.configure do |config|
config.logger = logger
config.excluded_exceptions = []
config.current_environment = Rails.env
config.environments = %w[ development ]
config.ssl_verification = false
config.dsn = 'http://#:#@fqdn/#'
end
# Gemfile
gem "sentry-raven", :git => "https://github.com/getsentry/raven-ruby.git"
Output of rake raven:test
rake raven:test
Client configuration:
-> server: <server_fqdn>
-> project_id: 2
-> public_key: #
-> secret_key: #
Sending a test event:
-> event ID: 9cd2f904a16647b5be435841e6b436c1
Done!
When I run the rake task, the exception is being logged in the application.
However, no other errors are being logged.
I have a dummy route and action:
# routes.rb
get '/error' => 'payslip#error', as: :payslip_error
# payslip_controller.rb
def error
logger.info Raven.client.configuration.send_in_current_environment?
1/0
end
The logger logs a true in the log file but the exception is never sent to the server.
If I replace the 1/0 with Raven.capture { 1/0 }, the exception is sent to the server.
I have also tried setting the $SENTRY_DSN value manually. But, no luck their either.
export SENTRY_DSN=http://#:#@fqdn/2
Command used to run the rails server: rails s (Running in the the development environment locally)
Am I missing something obvious?
Rails Version: 4.1.4
Let me know if you need any other information.
Thanks.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 53 (19 by maintainers)
I have the same problem, and as many of you suggested, setting
config.consider_all_requests_local = false(in development) solves the problem.However this means, unless I have misunderstood something, that error messages are no longer displayed in the browser. I have to go to Sentry to see the error message and details, and ss much as I would love to use Sentry, this is not really a good solution.
Any ideas?