Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Up: replace Airbrake with ExceptionNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
seawolf committed Jun 11, 2017
1 parent 8579ddb commit 5e51184
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ source 'https://rubygems.org'
ruby '2.4.1', patchlevel: '111'

# Application
# gem 'airbrake', '~> 4.0' # TODO: upgrade for Rails 5
gem 'rails', '~> 5.1.1'
gem 'puma', '~> 3.7'
# gem 'airbrake', '~> 6.1'
gem 'exception_notification', '~> 4.2.0'

# Views
gem 'jquery-rails', '~> 4.3.0'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ GEM
warden (~> 1.2.3)
diff-lcs (1.3)
erubi (1.6.0)
exception_notification (4.2.1)
actionmailer (>= 4.0, < 6)
activesupport (>= 4.0, < 6)
execjs (2.7.0)
factory_girl (4.8.0)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -201,6 +204,7 @@ DEPENDENCIES
db-query-matchers (~> 0.4.0)
debase
devise (~> 4.3.0)
exception_notification (~> 4.2.0)
factory_girl_rails (~> 4.8)
jquery-rails (~> 4.3.0)
listen (>= 3.0.5, < 3.2)
Expand Down
7 changes: 7 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,11 @@
:domain => 'oddityavenue.com',
:authentication => :plain
}

Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[ERROR] ",
:sender_address => %{"Exception Notifier" <[email protected]>},
:exception_recipients => %w{[email protected]}
}
end
7 changes: 7 additions & 0 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,11 @@
:domain => 'oddityavenue.com',
:authentication => :plain
}

Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[ERROR] ",
:sender_address => %{"Exception Notifier (Beta)" <[email protected]>},
:exception_recipients => %w{[email protected]}
}
end
7 changes: 7 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,11 @@
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.smtp_settings = { :domain => 'localhost:3000' }

Rails.application.config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[ERROR] ",
:sender_address => %{"Exception Notifier" <[email protected]>},
:exception_recipients => %w{[email protected]}
}
end
24 changes: 12 additions & 12 deletions config/initializers/airbrake.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
=begin TODO: upgrade for Rails 5
Airbrake.configure do |config|
config.api_key = {:project => 'oddityavenue', # the identifier you specified for your project in Redmine
:tracker => 'Bug', # the name of your Tracker of choice in Redmine
:api_key => ENV['HOPTOAD_API_KEY'], # the key you generated before in Redmine (NOT YOUR HOPTOAD API KEY!)
:assigned_to => ENV['HOPTOAD_USERNAME'], # the login of a user the ticket should get assigned to by default (optional.)
:priority => ENV['HOPTOAD_PRIORITY'], # the default priority (use a number, not a name. optional.)
:environment => ENV['RAILS_ENV'], # application environment, gets prepended to the issue's subject and is stored as a custom issue field. useful to distinguish errors on a test system from those on the production system (optional).
}.to_yaml
config.host = ENV['HOPTOAD_HOSTNAME'] # the hostname your Redmine runs at
config.port = ENV['HOPTOAD_PORTNUM'] # the port your Redmine runs at
config.secure = (config.port == 443) # sends data to your server via SSL (optional.)
=begin
Airbrake.configure do |c|
c.host = "http://redmine.seawolfsanctuary.com/"
c.environment = ENV['RAILS_ENV']
c.project_id = 11
c.project_key = CGI.escape({
tracker: 'Bug',
api_key: 'VgAabBoVyXBPjBCDVxBx',
project: 'oddityavenue'
}.to_json)
end
=end

0 comments on commit 5e51184

Please sign in to comment.