From 737550096e88d68f700185b325278a7b02a9e7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Fri, 28 May 2021 11:37:08 +0200 Subject: [PATCH] feat: add configurable log level --- .env.sample | 2 ++ config/environments/production.rb | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.sample b/.env.sample index cb3d1bc49..f37bb8833 100644 --- a/.env.sample +++ b/.env.sample @@ -2,6 +2,8 @@ RAILS_ENV=development PORT=3001 WEB_CONCURRENCY=0 RAILS_LOG_TO_STDOUT=true +# Log Level options: "INFO" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL" +RAILS_LOG_LEVEL=INFO RAILS_SERVE_STATIC_FILES=true SECRET_KEY_BASE=test APP_HOST=http://localhost:3001 diff --git a/config/environments/production.rb b/config/environments/production.rb index dd385facf..a03ef162b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -11,6 +11,8 @@ Rails.application.configure do config.logger = ActiveSupport::Logger.new(STDOUT) end + config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'INFO').to_sym + config.colorize_logging = false config.logger.formatter = StandardNotesFormatter.new @@ -64,10 +66,6 @@ Rails.application.configure do # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :info - # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ]