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:
parent
fd21a49a41
commit
7a965d7385
1 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,12 @@ Rails.application.configure do
|
||||||
# Use a different logger for distributed setups.
|
# Use a different logger for distributed setups.
|
||||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
# 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.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue