From b81d98718663598f46bc16ba42ff96f3e48f8d14 Mon Sep 17 00:00:00 2001 From: nadeemshahzad Date: Wed, 2 Oct 2024 09:59:17 +0500 Subject: [PATCH] feat: standardize Nginx Log Format for Datadog Integration --- playbooks/roles/nginx/templates/etc/nginx/nginx.conf.j2 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/nginx/templates/etc/nginx/nginx.conf.j2 b/playbooks/roles/nginx/templates/etc/nginx/nginx.conf.j2 index 1c3494e5434..21dfc0503ca 100644 --- a/playbooks/roles/nginx/templates/etc/nginx/nginx.conf.j2 +++ b/playbooks/roles/nginx/templates/etc/nginx/nginx.conf.j2 @@ -68,9 +68,10 @@ http { 'upstream_connect_time=$upstream_connect_time upstream_header_time=$upstream_header_time'; {% if NGINX_ENABLE_REQUEST_TRACKING_ID -%} - log_format cf_custom '$http_x_forwarded_for - $remote_addr - $remote_user $http_x_forwarded_proto [$time_local] $request_tracking_id ' - '"$request" $status $body_bytes_sent $request_time ' - '"$http_referer" "$http_user_agent"'; + log_format cf_custom '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent $request_time ' + '"$http_referer" "$http_user_agent" ' + '"$http_x_forwarded_for" $http_x_forwarded_proto $request_tracking_id'; {% endif %} log_format json_analytics escape=json '{'