Skip to content

Commit

Permalink
Add request_id to logs for production and staging
Browse files Browse the repository at this point in the history
It will prepend a request unique id to each log lines, it makes it
easier to debug individual request.
  • Loading branch information
rioug committed Jul 30, 2024
1 parent 53e3621 commit bfd0e7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

# 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, {
Expand Down
1 change: 1 addition & 0 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

# 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, {
Expand Down

0 comments on commit bfd0e7f

Please sign in to comment.