From 7461d84018b446c2eae16800a86f3011410a456a Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 1 Feb 2023 17:57:27 +0100 Subject: [PATCH] feat(log): log ip and correlation id --- app/controllers/application_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c7c1093ef..f9ee04f23 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -198,7 +198,9 @@ class ApplicationController < ActionController::Base payload.merge!({ user_agent: request.user_agent, user_id: current_user&.id, - user_roles: current_user_roles + user_roles: current_user_roles, + client_ip: request.headers['X-Forwarded-For'], + request_id: request.headers['X-Request-ID'] }.compact) if browser.known?