Skip to content

Commit

Permalink
Merge pull request #73 from edx/nadeem/Nginx-log
Browse files Browse the repository at this point in the history
feat: standardize Nginx Log Format for Datadog Integration
  • Loading branch information
nadeemshahzad authored Oct 2, 2024
2 parents 47e19f3 + b81d987 commit 5a19e68
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions playbooks/roles/nginx/templates/etc/nginx/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 '{'
Expand Down

0 comments on commit 5a19e68

Please sign in to comment.