From 866a1b4bcba24bd7f7c3d6a83ee654124c751285 Mon Sep 17 00:00:00 2001 From: Yasir Azgar Date: Sat, 28 Oct 2023 22:26:53 +0530 Subject: [PATCH 1/5] 11714 fix bugsnag warn --- config/initializers/bugsnag.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/initializers/bugsnag.rb b/config/initializers/bugsnag.rb index f4cb209d7d6..41c7feb58b0 100644 --- a/config/initializers/bugsnag.rb +++ b/config/initializers/bugsnag.rb @@ -1,4 +1,11 @@ Bugsnag.configure do |config| config.api_key = ENV['BUGSNAG_API_KEY'] - config.notify_release_stages = %w(production staging) + config.release_stage = ENV['RAILS_ENV'] + + release_stages_to_notify = if ENV['RAILS_ENV'].in? %w(test development) + nil + else + Array[ENV['RAILS_ENV']] + end + config.notify_release_stages = release_stages_to_notify end From eb82accb7911f440ce980d7b865db9474f4273e8 Mon Sep 17 00:00:00 2001 From: Yasir Azgar Date: Sat, 4 Nov 2023 19:35:53 +0530 Subject: [PATCH 2/5] revert unwanted change --- config/initializers/bugsnag.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config/initializers/bugsnag.rb b/config/initializers/bugsnag.rb index 41c7feb58b0..dc2a379c89f 100644 --- a/config/initializers/bugsnag.rb +++ b/config/initializers/bugsnag.rb @@ -2,10 +2,5 @@ config.api_key = ENV['BUGSNAG_API_KEY'] config.release_stage = ENV['RAILS_ENV'] - release_stages_to_notify = if ENV['RAILS_ENV'].in? %w(test development) - nil - else - Array[ENV['RAILS_ENV']] - end - config.notify_release_stages = release_stages_to_notify + config.notify_release_stages = %w(production staging) end From 5eed5007866bae7ddff4f344b9f9fdb64121b605 Mon Sep 17 00:00:00 2001 From: Yasir Azgar Date: Sun, 12 Nov 2023 17:21:02 +0530 Subject: [PATCH 3/5] supress bugsnag warn in dev --- config/initializers/bugsnag.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/initializers/bugsnag.rb b/config/initializers/bugsnag.rb index dc2a379c89f..1ebbd98e4e7 100644 --- a/config/initializers/bugsnag.rb +++ b/config/initializers/bugsnag.rb @@ -1,6 +1,9 @@ Bugsnag.configure do |config| config.api_key = ENV['BUGSNAG_API_KEY'] config.release_stage = ENV['RAILS_ENV'] - + if Rails.env.development? + config.logger = Logger.new(STDOUT) # In Rails apps, create a new logger to avoid changing the Rails log level + config.logger.level = Logger::ERROR + end config.notify_release_stages = %w(production staging) end From b119a97eafd9e1414cf0b8ec7fead27b6b1158f0 Mon Sep 17 00:00:00 2001 From: yasir azgar Date: Sun, 12 Nov 2023 21:12:26 -0800 Subject: [PATCH 4/5] Update config/initializers/bugsnag.rb Co-authored-by: Maikel --- config/initializers/bugsnag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/bugsnag.rb b/config/initializers/bugsnag.rb index 1ebbd98e4e7..b9676424819 100644 --- a/config/initializers/bugsnag.rb +++ b/config/initializers/bugsnag.rb @@ -1,6 +1,6 @@ Bugsnag.configure do |config| config.api_key = ENV['BUGSNAG_API_KEY'] - config.release_stage = ENV['RAILS_ENV'] + config.release_stage = Rails.env if Rails.env.development? config.logger = Logger.new(STDOUT) # In Rails apps, create a new logger to avoid changing the Rails log level config.logger.level = Logger::ERROR From 703ef8a203422df688ec1cf08442867e83409afb Mon Sep 17 00:00:00 2001 From: yasir azgar Date: Sun, 12 Nov 2023 21:12:32 -0800 Subject: [PATCH 5/5] Update config/initializers/bugsnag.rb Co-authored-by: Maikel --- config/initializers/bugsnag.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/bugsnag.rb b/config/initializers/bugsnag.rb index b9676424819..bd90c706997 100644 --- a/config/initializers/bugsnag.rb +++ b/config/initializers/bugsnag.rb @@ -1,8 +1,9 @@ Bugsnag.configure do |config| config.api_key = ENV['BUGSNAG_API_KEY'] config.release_stage = Rails.env + # Avoid missing API key warning without changing the Rails log level. if Rails.env.development? - config.logger = Logger.new(STDOUT) # In Rails apps, create a new logger to avoid changing the Rails log level + config.logger = Logger.new(STDOUT) config.logger.level = Logger::ERROR end config.notify_release_stages = %w(production staging)