diff --git a/config/environments/production.rb b/config/environments/production.rb index 5b9acb497..ced1f7013 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -76,8 +76,8 @@ Rails.application.configure do # Use a different logger for distributed setups. # require 'syslog/logger' # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV['RAILS_LOG_TO_STDOUT'].present? + + if ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_LOG_TO_STDOUT', true)) logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 5243a2d59..3adfe1e0c 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -94,7 +94,7 @@ Rails.application.configure do # require 'syslog/logger' config.logger = ActiveSupport::Logger.new(Rails.root.join("log/#{Rails.env}.log"), 1, ENV.fetch('LOG_SIZE', '1024').to_i.megabytes) - if ENV['RAILS_LOG_TO_STDOUT'].present? + if ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_LOG_TO_STDOUT', true)) logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger)