Bug: Disable logging to file on asset precompile (#637)

This commit is contained in:
Pranav Raj S
2020-03-22 20:38:49 +05:30
committed by GitHub
parent 1c4566df66
commit a94f14ca22
6 changed files with 363 additions and 185 deletions

View File

@@ -83,13 +83,16 @@ Rails.application.configure do
config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# 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?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
else
config.logger = ActiveSupport::Logger.new(
Rails.root.join('log', Rails.env + '.log'),
1,
ENV.fetch('LOG_SIZE', '1024').to_i.megabytes
)
end
# Do not dump schema after migrations.