Skip to content

Commit

Permalink
Add RAILS_LOG_TO_STDOUT support
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfb committed Dec 3, 2024
1 parent 93bc272 commit d0fabd1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# STDOUT used for Tomcat/catalina.out logging
config.logger = ActiveSupport::Logger.new("#{Rails.root}/log/production.log")
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
else
config.logger = ActiveSupport::Logger.new("#{Rails.root}/log/production.log")
end

# Use a different cache store in production
# config.cache_store = :mem_cache_store
Expand Down

0 comments on commit d0fabd1

Please sign in to comment.