Skip to content
This repository was archived by the owner on Sep 29, 2020. It is now read-only.

Commit 306e4f8

Browse files
committed
Add Rollbar gem
1 parent c2a812c commit 306e4f8

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ gem 'bootsnap', '>= 1.1.0', require: false
3535

3636
gem 'activeadmin'
3737
gem 'devise'
38+
gem 'rollbar'
3839
gem 'sequenced'
3940
gem 'simple_form'
4041

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ GEM
207207
responders (2.4.0)
208208
actionpack (>= 4.2.0, < 5.3)
209209
railties (>= 4.2.0, < 5.3)
210+
rollbar (2.23.2)
210211
ruby_dep (1.5.0)
211212
rubyzip (1.2.2)
212213
sass (3.6.0)
@@ -286,6 +287,7 @@ DEPENDENCIES
286287
puma (~> 3.11)
287288
rails (~> 5.2.1)
288289
redis (~> 4.0)
290+
rollbar
289291
sass-rails (~> 5.0)
290292
selenium-webdriver
291293
sequenced

config/initializers/rollbar.rb

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Rollbar.configure do |config|
2+
# Without configuration, Rollbar is enabled in all environments.
3+
# To disable in specific environments, set config.enabled=false.
4+
5+
config.access_token = ENV['ROLLBAR_ACCESS_TOKEN']
6+
7+
# Here we'll disable in 'test' and 'development':
8+
if Rails.env.test? && Rails.env.development?
9+
config.enabled = false
10+
end
11+
12+
# By default, Rollbar will try to call the `current_user` controller method
13+
# to fetch the logged-in user object, and then call that object's `id`
14+
# method to fetch this property. To customize:
15+
# config.person_method = "my_current_user"
16+
# config.person_id_method = "my_id"
17+
18+
# Additionally, you may specify the following:
19+
# config.person_username_method = "username"
20+
# config.person_email_method = "email"
21+
22+
# If you want to attach custom data to all exception and message reports,
23+
# provide a lambda like the following. It should return a hash.
24+
# config.custom_data_method = lambda { {:some_key => "some_value" } }
25+
26+
# Add exception class names to the exception_level_filters hash to
27+
# change the level that exception is reported at. Note that if an exception
28+
# has already been reported and logged the level will need to be changed
29+
# via the rollbar interface.
30+
# Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
31+
# 'ignore' will cause the exception to not be reported at all.
32+
# config.exception_level_filters.merge!('MyCriticalException' => 'critical')
33+
#
34+
# You can also specify a callable, which will be called with the exception instance.
35+
# config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' })
36+
37+
# Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
38+
# is not installed)
39+
# config.use_async = true
40+
# Supply your own async handler:
41+
# config.async_handler = Proc.new { |payload|
42+
# Thread.new { Rollbar.process_from_async_handler(payload) }
43+
# }
44+
45+
# Enable asynchronous reporting (using sucker_punch)
46+
# config.use_sucker_punch
47+
48+
# Enable delayed reporting (using Sidekiq)
49+
# config.use_sidekiq
50+
# You can supply custom Sidekiq options:
51+
# config.use_sidekiq 'queue' => 'default'
52+
53+
# If your application runs behind a proxy server, you can set proxy parameters here.
54+
# If https_proxy is set in your environment, that will be used. Settings here have precedence.
55+
# The :host key is mandatory and must include the URL scheme (e.g. 'http://'), all other fields
56+
# are optional.
57+
#
58+
# config.proxy = {
59+
# host: 'http://some.proxy.server',
60+
# port: 80,
61+
# user: 'username_if_auth_required',
62+
# password: 'password_if_auth_required'
63+
# }
64+
65+
# If you run your staging application instance in production environment then
66+
# you'll want to override the environment reported by `Rails.env` with an
67+
# environment variable like this: `ROLLBAR_ENV=staging`. This is a recommended
68+
# setup for Heroku. See:
69+
# https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
70+
config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env
71+
end

0 commit comments

Comments
 (0)