From dcf9291fcec5c49ebc4c4a9946f9cd98b14cfb37 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sun, 22 Jan 2017 11:17:44 -0600 Subject: [PATCH] limit log size --- config/environments/production.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 09e8e0c5b..54a611321 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -4,10 +4,12 @@ Rails.application.configure do # Code is not reloaded between requests. config.cache_classes = true - # Use a different logger for distributed setups. + # Use a different logger for distributed setups. # require 'syslog/logger' # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, 50 * 1024 * 1024) + if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter