fix: Log config env variable typecasting (#1792)

This commit is contained in:
Sojan Jose
2021-02-23 20:48:15 +05:30
committed by GitHub
parent 01ee3d7f8b
commit f424a832f4
2 changed files with 3 additions and 3 deletions

View File

@@ -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)