Skip to content

Commit

Permalink
PMM-9315 use logfmt format for nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Oct 30, 2024
1 parent ae6b2fb commit e5eaac0
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions build/ansible/roles/loki/files/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

log_format json_format escape=json '{'
'"time_local": "$time_local",'
'"host": "$http_host",'
'"remote_addr": "$remote_addr",'
'"request_method": "$request_method",'
'"request": "$request_uri",'
'"request_time": "$request_time",'
'"body_bytes_sent": "$body_bytes_sent",'
'"server_protocol": "$server_protocol",'
'"status": "$status",'
'"http_referrer":"$http_referer",'
'"http_x_forwarded_for": "$http_x_forwarded_for",'
'"http_user_agent": "$http_user_agent"'
'}';

access_log /dev/stdout json_format;
log_format ext_format
'time="$time_iso8601" '
'host=$http_host '
'remote_addr=$remote_addr '
'request_method=$request_method '
'request="$request_uri" '
'request_time=$request_time '
'body_bytes_sent=$body_bytes_sent '
'server_protocol="$server_protocol" '
'status=$status '
'http_referrer="$http_referer" '
'http_x_forwarded_for="$http_x_forwarded_for" '
'http_user_agent="$http_user_agent"';

access_log /dev/stdout ext_format;

sendfile on;
gzip on;
Expand Down

0 comments on commit e5eaac0

Please sign in to comment.