Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Airbrake for your Sinatra application #10

Open
bih opened this issue Apr 13, 2017 · 0 comments
Open

Setup Airbrake for your Sinatra application #10

bih opened this issue Apr 13, 2017 · 0 comments
Labels

Comments

@bih
Copy link

bih commented Apr 13, 2017

Installation

Using bundler

Add the Airbrake gem to your Gemfile:

gem 'airbrake', '~> 6.0'

Manual

Invoke the following command from your terminal:

gem install airbrake

Configuration

To use Airbrake with Sinatra, simply require the gem, configure it and use our Rack middleware (You can find your project ID and API KEY with your project's settings):

# myapp.rb
require 'sinatra/base'
require 'airbrake'

Airbrake.configure do |c|
  c.project_id = <Your project ID>
  c.project_key = '<Your project API KEY>'

  # Display debug output.
  c.logger.level = Logger::DEBUG
end

class MyApp < Sinatra::Base
  use Airbrake::Rack::Middleware

  get('/') { 1/0 }
end

run MyApp.run!

For more information please visit our official GitHub repo.

@bih bih added the airbrake label Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant