From e6194da82dfd2259be59f1baa8485fa1b3109177 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 21 Jul 2023 11:26:06 +0200 Subject: [PATCH] DS_LOG_LEVEL control rails log level --- config/env.example.optional | 4 ++++ config/environments/production.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/env.example.optional b/config/env.example.optional index 4f492107632..4d1d0362760 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -215,3 +215,7 @@ POSTGIS_EXTENSION_DISABLED="" REDIS_CACHE_URL="" REDIS_CACHE_SSL="enabled" REDIS_CACHE_SSL_VERIFY_NONE="enabled" + +# Setup log level, info if nil +# can be debug, info, warn, error, fatal, and unknown +DS_LOG_LEVEL='info' diff --git a/config/environments/production.rb b/config/environments/production.rb index 9b6e2d06f93..5bc067cb7c4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -52,7 +52,7 @@ # Use the lowest log level to ensure availability of diagnostic information # when problems arise. - config.log_level = ENV["DS_ENV"] == "staging" ? :debug : :info + config.log_level = ENV["DS_LOG_LEVEL"].presence&.to_sym || :info # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ]