From f1dfbafdcde1c6b8fb45c188f2ee51ffef0ce9e9 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 23 Nov 2018 12:53:44 +0100 Subject: [PATCH] Refactoring: config.log_formatter is for all environments the same but configured in each. --- config/application.rb | 3 +++ config/environments/development.rb | 3 --- config/environments/production.rb | 6 ------ config/environments/test.rb | 3 --- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/config/application.rb b/config/application.rb index d3f556e1f..5588e39a0 100644 --- a/config/application.rb +++ b/config/application.rb @@ -50,6 +50,9 @@ module Zammad config.active_job.queue_adapter = :delayed_job + # Use custom logger to log Thread id next to Process pid + config.log_formatter = ::Logger::Formatter.new + # REST api path config.api_path = '/api/v1' diff --git a/config/environments/development.rb b/config/environments/development.rb index cdb296b42..8813ec693 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -48,9 +48,6 @@ Rails.application.configure do # yet still be able to expire them through the digest params. config.assets.digest = false - # format log - config.log_formatter = Logger::Formatter.new - # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages. diff --git a/config/environments/production.rb b/config/environments/production.rb index 15c68d676..23c83beee 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -71,15 +71,9 @@ Rails.application.configure do # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - # format log - config.log_formatter = Logger::Formatter.new - # overwrite default Rails TRUSTED_PROXIES # because otherwise IPs from private ranges will be # ignored for Session logging and fall back to localhost diff --git a/config/environments/test.rb b/config/environments/test.rb index 1fed9b588..cbee70943 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -43,9 +43,6 @@ Rails.application.configure do # Enable autoload config.dependency_loading = true - # format log - config.log_formatter = Logger::Formatter.new - config.after_initialize do ActiveRecord::Base.logger = Rails.logger.clone ActiveRecord::Base.logger.level = Logger::INFO