|
| 1 | +Rollbar.configure do |config| |
| 2 | + config.access_token = ENV['ROLLBAR_ACCESS_TOKEN'] |
| 3 | + |
| 4 | + # Without configuration, Rollbar is enabled in all environments. |
| 5 | + # To disable in specific environments, set config.enabled=false. |
| 6 | + # Enable rollbar for production only |
| 7 | + config.enabled = Rails.env.production? && config.access_token.present? |
| 8 | + |
| 9 | + # By default, Rollbar will try to call the `current_user` controller method |
| 10 | + # to fetch the logged-in user object, and then call that object's `id`, |
| 11 | + # `username`, and `email` methods to fetch those properties. To customize: |
| 12 | + # config.person_method = "my_current_user" |
| 13 | + config.person_id_method = 'id_as_hash' |
| 14 | + config.person_username_method = 'id_as_hash' |
| 15 | + config.person_email_method = 'id_as_hash' |
| 16 | + |
| 17 | + # If you want to attach custom data to all exception and message reports, |
| 18 | + # provide a lambda like the following. It should return a hash. |
| 19 | + # config.custom_data_method = lambda { {:some_key => "some_value" } } |
| 20 | + |
| 21 | + # Add exception class names to the exception_level_filters hash to |
| 22 | + # change the level that exception is reported at. Note that if an exception |
| 23 | + # has already been reported and logged the level will need to be changed |
| 24 | + # via the rollbar interface. |
| 25 | + # Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore' |
| 26 | + # 'ignore' will cause the exception to not be reported at all. |
| 27 | + # config.exception_level_filters.merge!('MyCriticalException' => 'critical') |
| 28 | + # |
| 29 | + # You can also specify a callable, which will be called with the exception instance. |
| 30 | + # config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' }) |
| 31 | + |
| 32 | + # Enable asynchronous reporting (uses girl_friday or Threading if girl_friday |
| 33 | + # is not installed) |
| 34 | + # config.use_async = true |
| 35 | + # Supply your own async handler: |
| 36 | + # config.async_handler = Proc.new { |payload| |
| 37 | + # Thread.new { Rollbar.process_from_async_handler(payload) } |
| 38 | + # } |
| 39 | + |
| 40 | + # Enable asynchronous reporting (using sucker_punch) |
| 41 | + # config.use_sucker_punch |
| 42 | + |
| 43 | + # Enable delayed reporting (using Sidekiq) |
| 44 | + # config.use_sidekiq |
| 45 | + # You can supply custom Sidekiq options: |
| 46 | + # config.use_sidekiq 'queue' => 'default' |
| 47 | + |
| 48 | + # If you run your staging application instance in production environment then |
| 49 | + # you'll want to override the environment reported by `Rails.env` with an |
| 50 | + # environment variable like this: `ROLLBAR_ENV=staging`. This is a recommended |
| 51 | + # setup for Heroku. See: |
| 52 | + # https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment |
| 53 | + config.environment = ENV['ROLLBAR_ENV'] || Rails.env |
| 54 | +end |
0 commit comments