Skip to content

pandastream/raven-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raven-Ruby

Build Status

A client and integration layer for the Sentry error reporting API.

This library is still forming, so if you are looking to just use it, please check back in a few weeks.

Installation

Add the following to your Gemfile:

gem "sentry-raven", :git => "https://github.com/coderanger/raven-ruby.git"

Or install manually

$ gem install sentry-raven

Usage

Rails 3

Add a config/initializers/raven.rb containing:

require 'raven'

Raven.configure do |config|
  config.dsn = 'http://public:[email protected]/project-id'
end

Rails 2

No support for Rails 2 yet.

Other Rack Servers

Basic RackUp file.

require 'raven'

Raven.configure do |config|
  config.dsn = 'http://public:[email protected]/project-id'
end

use Raven::Rack

Other Ruby

require 'raven'

Raven.configure do |config|
  config.dsn = 'http://public:[email protected]/project-id'

  # manually configure environment if ENV['RACK_ENV'] is not defined
  config.current_environment = 'production'
end

Raven.capture # Global style

Raven.capture do # Block style
  1 / 0
end

Testing

$ bundle install
$ rake spec

Notifications in development mode

By default events will only be sent to Sentry if your application is running in a production environment. This is configured by default if you are running a Rack application (i.e. anytime ENV['RACK_ENV'] is set).

You can configure Raven to run in non-production environments by configuring the environments whitelist:

require 'raven'

Raven.configure do |config|
  config.dsn = 'http://public:[email protected]/project-id'
  config.environments = %w[ development production ]
end

Excluding exceptions

If you never wish to be notified of certain exceptions, specify 'excluded_exceptions' in your config file.

In the example below, the exceptions Rails uses to generate 404 responses will be suppressed.

require 'raven'

Raven.configure do |config|
  config.dsn = 'http://public:[email protected]/project-id'
  config.excluded_exceptions = ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound']
end

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published