Skip to content
This repository
Browse code

Log production errors to Airbrake.

  • Loading branch information...
commit 2b9404754df363d83a66b7ab88aa30e704d8f166 1 parent eff3d13
Brian Michalski bamnet authored
3  Gemfile
@@ -3,6 +3,9 @@ source 'http://rubygems.org'
3 3
4 4 gem "rails", "3.2.8"
5 5
  6 +# Load the gems used for remote reporting.
  7 +eval File.read('Gemfile-reporting')
  8 +
6 9 group :concerto_plugins do
7 10 eval File.read('Gemfile-plugins')
8 11 end
2  Gemfile-reporting
... ... @@ -0,0 +1,2 @@
  1 +# Airbrake is used to remotely log exceptions.
  2 +gem 'airbrake'
7 Gemfile.lock
@@ -28,6 +28,9 @@ GEM
28 28 activesupport (3.2.8)
29 29 i18n (~> 0.6)
30 30 multi_json (~> 1.0)
  31 + airbrake (3.1.5)
  32 + builder
  33 + girl_friday
31 34 arel (3.0.2)
32 35 attachable (0.0.5)
33 36 bcrypt-ruby (3.0.1)
@@ -40,6 +43,7 @@ GEM
40 43 coffee-script-source
41 44 execjs
42 45 coffee-script-source (1.3.3)
  46 + connection_pool (0.9.2)
43 47 delayed_job (3.0.3)
44 48 activesupport (~> 3.0)
45 49 delayed_job_active_record (0.3.3)
@@ -53,6 +57,8 @@ GEM
53 57 erubis (2.7.0)
54 58 execjs (1.4.0)
55 59 multi_json (~> 1.0)
  60 + girl_friday (0.10.0)
  61 + connection_pool (~> 0.9.0)
56 62 hike (1.2.1)
57 63 i18n (0.6.1)
58 64 journey (1.0.4)
@@ -126,6 +132,7 @@ PLATFORMS
126 132 ruby
127 133
128 134 DEPENDENCIES
  135 + airbrake
129 136 attachable (>= 0.0.5)
130 137 cancan
131 138 coffee-rails (~> 3.2.1)
21 config/initializers/13-airbrake.rb
... ... @@ -0,0 +1,21 @@
  1 +if ActiveRecord::Base.connection.table_exists? 'concerto_configs'
  2 + if ConcertoConfig.columns_hash.has_key?("plugin_id")
  3 + ConcertoConfig.make_concerto_config("allow_remote_error_reporting", "true", :value_type => "boolean")
  4 + end
  5 +end
  6 +
  7 +Airbrake.configure do |config|
  8 + def config.api_key
  9 + if ConcertoConfig[:allow_remote_error_reporting] == "true"
  10 + return '52adf2979c2ab87c634612bef9deaaf2'
  11 + else
  12 + return nil
  13 + end
  14 + end
  15 + config.async = (RUBY_VERSION.to_f > 1.8)
  16 + config.user_attributes = []
  17 + config.secure = true
  18 +
  19 + # Uncomment the following to start reporting development mode errors.
  20 + #config.development_environments = []
  21 +end

0 comments on commit 2b94047

Please sign in to comment.
Something went wrong with that request. Please try again.