Add timestamp to Rails logger in staging and prod so that info in logs can be accurately compared with data in the DB

This commit is contained in:
luisramos0
2019-12-05 11:59:49 +00:00
committed by Maikel Linke
parent 6cfb060184
commit 23ec66e338
2 changed files with 10 additions and 4 deletions

View File

@@ -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

View File

@@ -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