Pull Request #2637 - Add Rails 5 log to STDOUT env variable support (RAILS_LOG_TO_STDOUT). Huge thanks to @thegcat.

This commit is contained in:
Thorsten Eckel 2019-07-01 17:10:17 +02:00
parent fd21a49a41
commit 7a965d7385

View file

@ -54,6 +54,12 @@ Rails.application.configure do
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'