From 5f5d12424146ee631ae636ddebd1469dc7ec521e Mon Sep 17 00:00:00 2001 From: Thomas Burkhalter Date: Wed, 27 Dec 2023 22:20:21 +0100 Subject: [PATCH] Make Lograge toggleable --- config/environments/production.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index a76170fb..19ad5bd6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -118,7 +118,8 @@ } # Use log rage - config.lograge.enabled = true + enabled = ENV.fetch('RAILS_LOGRAGE_ENABLED', 'true') + config.lograge.enabled = ActiveModel::Type::Boolean.new.cast(enabled) config.lograge.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new($stdout)) config.lograge.ignore_actions = ['StatusController#health', 'StatusController#readiness'] config.lograge.custom_payload do |controller|