Add request_id to logs for production and staging

It will prepend a request unique id to each log lines, it makes it
easier to debug individual request.
This commit is contained in:
Gaetan Craig-Riou
2024-07-30 11:38:46 +10:00
parent 53e3621e04
commit bfd0e7f784
2 changed files with 2 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ Openfoodnetwork::Application.configure do
# Configure logging:
config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }
config.log_tags = [:request_id]
# Use a different cache store in production
config.cache_store = :redis_cache_store, {

View File

@@ -40,6 +40,7 @@ Openfoodnetwork::Application.configure do
# Configure logging:
config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }
config.log_tags = [:request_id]
# Use a different cache store in production
config.cache_store = :redis_cache_store, {