From 3ae1f98dc84b3e23f3d6f8b868375de2519cd863 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Wed, 21 Oct 2020 12:06:12 +1000 Subject: [PATCH] DEV: Add env var to disable ActiveRecord logging in development (#10979) If RAILS_DISABLE_ACTIVERECORD_LOGS=1 is passed when starting Rails, none of the query log output will show. This is very useful for debugging with breakpoints because logs are not flooding in constantly. --- config/environments/development.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 55a3f3bc106..9659c1ca5b5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -93,6 +93,10 @@ Discourse::Application.configure do end end + if ENV["RAILS_DISABLE_ACTIVERECORD_LOGS"] == "1" + ActiveRecord::Base.logger = nil + end + if ENV['BULLET'] Bullet.enable = true Bullet.rails_logger = true