diff --git a/config/environments/production.rb b/config/environments/production.rb index af72e56b7d..1b762a16d0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -36,8 +36,11 @@ Openfoodnetwork::Application.configure do # See everything in the log (default is :info) config.log_level = :info - # Use a different logger for distributed setups - # config.logger = SyslogLogger.new + # Configure logging + Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) + Rails.logger.formatter = Logger::Formatter.new + Rails.logger.datetime_format = "%Y-%m-%d %H:%M:%S" + config.logger = Rails.logger # Use a different cache store in production memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 936897b31b..15124d3441 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -36,8 +36,11 @@ Openfoodnetwork::Application.configure do # See everything in the log (default is :info) # config.log_level = :debug - # Use a different logger for distributed setups - # config.logger = SyslogLogger.new + # Configure logging + Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) + Rails.logger.formatter = Logger::Formatter.new + Rails.logger.datetime_format = "%Y-%m-%d %H:%M:%S" + config.logger = Rails.logger # Use a different cache store in production memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i