-
Notifications
You must be signed in to change notification settings - Fork 0
Customizing your airbrake.rb
END OF SUPPORT WARNING: On November 24, 2016 Airbrake v4 won't be supported anymore and this wiki will be deleted. Read more & discuss: https://github.com/airbrake/airbrake/issues/596
DEPRECATION WARNING: The information presented on this page is related to Airbrake v4 only. If you seek for information for Airbrake v5, please refer to our README!
Airbrake.configure do |config|
config.api_key = '********************************'
end
Note: Extra options are configured by adding extra lines to the above block
config.development_environments = []
the default will be taken from Rails.env
you can overwrite this if it will be useful for your deployment.
config.environment_name = "test"
Airbrake ignores the following exceptions by default
# Ignore Defaults
AbstractController::ActionNotFound
ActiveRecord::RecordNotFound
ActionController::RoutingError
ActionController::InvalidAuthenticityToken
ActionController::UnknownAction
ActionController::UnknownHttpMethod
CGI::Session::CookieStore::TamperedWithCookie
Mongoid::Errors::DocumentNotFound
ActionController::UnknownFormat
config.ignore << "ActiveRecord::IgnoreThisError"
config.ignore_only = ["ActiveRecord::IgnoreThisError"]
config.ignore_only = []
# string version
config.ignore_user_agent << 'IgnoredUserAgent'
# regex version
config.ignore_user_agent << /IgnoredUserAgent/
config.ignore_by_filter do |exception_data|
true if exception_data[:error_class] == "RuntimeError"
end
sensitive values will be replaced with [FILTERED]
config.params_filters << "credit_card_number"
This will show up in the airbrake ui as:
credit_card_number: [FILTERED]
Here are the defaults:
# this example taken from the rails console of a test project
airbrake_test >> Airbrake.configuration.params_filters
=> [
[0] "password",
[1] "password_confirmation"
]
Note: when rescuing exceptions within an ActionController method airbrake will reuse filters specified by #filter_parameter_logging.**