Custom formatter
This commit is contained in:
@@ -14,6 +14,9 @@ Rails.application.configure do
|
||||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
|
||||
require 'custom_log_formatter'
|
||||
config.log_formatter = CustomLogFormatter.new
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
@@ -10,7 +10,12 @@ Rails.application.configure do
|
||||
# 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)
|
||||
MAX_LOG_MEGABYTES = 50
|
||||
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, MAX_LOG_MEGABYTES * 1024 * 1024)
|
||||
|
||||
require 'custom_log_formatter'
|
||||
config.log_formatter = CustomLogFormatter.new
|
||||
config.logger.formatter = config.log_formatter
|
||||
|
||||
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
||||
logger = ActiveSupport::Logger.new(STDOUT)
|
||||
|
||||
Reference in New Issue
Block a user