Merge pull request #1297 from internetee/tune-airbrake-gem

Tune airbrake gem
This commit is contained in:
Timo Võhmar 2019-09-13 12:48:59 +03:00 committed by GitHub
commit 46d24f770e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 25 deletions

View file

@ -106,9 +106,10 @@ GEM
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
airbrake (6.0.0)
airbrake-ruby (~> 2.0)
airbrake-ruby (2.0.0)
airbrake (9.4.3)
airbrake-ruby (~> 4.6)
airbrake-ruby (4.6.0)
rbtree3 (~> 0.5)
akami (1.3.1)
gyoku (>= 0.4.0)
nokogiri
@ -336,6 +337,7 @@ GEM
activesupport (>= 3.0)
i18n
polyamorous (~> 1.1)
rbtree3 (0.5.0)
rdoc (4.3.0)
regexp_parser (1.5.1)
request_store (1.4.1)

View file

@ -0,0 +1,18 @@
Airbrake.configure do |config|
config.host = ENV['airbrake_host']
config.project_id = ENV['airbrake_project_id']
config.project_key = ENV['airbrake_project_key']
config.root_directory = Rails.root
config.logger =
if ENV['RAILS_LOG_TO_STDOUT'].present?
Logger.new(STDOUT, level: Rails.logger.level)
else
Logger.new(
Rails.root.join('log', 'airbrake.log'),
level: Rails.logger.level
)
end
config.environment = ENV['airbrake_env'] || Rails.env
config.ignore_environments = %w[test]
config.blacklist_keys = Rails.application.config.filter_parameters
end

View file

@ -1,22 +0,0 @@
module Patches
module Airbrake
module SyncSender
def build_https(uri)
super.tap do |req|
req.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
end
end
end
end
Airbrake::SyncSender.prepend(::Patches::Airbrake::SyncSender)
Airbrake.configure do |config|
config.host = ENV['airbrake_host']
config.project_id = ENV['airbrake_project_id']
config.project_key = ENV['airbrake_project_key']
config.environment = ENV['airbrake_env'] || Rails.env
config.ignore_environments = %w(development test)
end