Browse Source

Refactoring: config.log_formatter is for all environments the same but configured in each.

Thorsten Eckel 6 years ago
parent
commit
f1dfbafdcd

+ 3 - 0
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'
 

+ 0 - 3
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.

+ 0 - 6
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

+ 0 - 3
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