Skip to content

Commit

Permalink
Merge pull request #26 from tombatchelor/Add-TraceID-to-Nginx-Access-Log
Browse files Browse the repository at this point in the history
Added Trace ID to access log
  • Loading branch information
tombatchelor authored Nov 13, 2019
2 parents 5035bec + 64793a4 commit 0f8a0e1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web_server/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ http {

opentracing_tag http_user_agent $http_user_agent;

log_format trace_log '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'$http_x_b3_traceid $opentracing_context_x_b3_traceid';

sendfile on;

upstream cars-app {
Expand All @@ -20,6 +25,8 @@ http {
server {
listen 80;

access_log /var/log/nginx/access.log trace_log;

location / {
opentracing_operation_name $uri;
opentracing_propagate_context;
Expand Down

0 comments on commit 0f8a0e1

Please sign in to comment.