Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: extend logging #1685

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 29 additions & 32 deletions nginx/nginx.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,48 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format json escape=json '{'
'"time_local": "$time_local", '
'"core":'
'"date_access": "$time_iso8601",'
'"http":'
'{'
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"request": "$request", '
'"status": "$status", '
'"body_bytes_sent": "$body_bytes_sent", '
'"http_referer": "$http_referer", '
'"http_user_agent": "$http_user_agent" ,'
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"request_method": "$request_method", '
'"request_time": "$request_time", '
'"host": "$host", '
'"server_name": "$server_name"'
'"ident": "$remote_user",'
'"status_code": $status,'
'"referer": "$http_referer",'
'"useragent": "$http_user_agent",'
'"x_forward_for": "$http_x_forwarded_for"'
'"method": "$request_method",'
'"request_time": $request_time,'
'"host": "$http_host",'
'"uri": "$uri",'
'"request_id": "$request_id",'
'"request_length": $request_length,'
'"request_method": "$request_method",'
'"protocol": "$server_protocol",'
'},'
'"ssl":'
'"ingress":'
'{'
'"ssl_cipher": "$ssl_cipher",'
'"ssl_client_cert": "$ssl_client_cert",'
'"ssl_client_fingerprint": "$ssl_client_fingerprint",'
'"ssl_client_i_dn": "$ssl_client_i_dn",'
'"ssl_client_raw_cert": "$ssl_client_raw_cert",'
'"ssl_client_s_dn": "$ssl_client_s_dn",'
'"ssl_client_serial": "$ssl_client_serial",'
'"ssl_client_verify": "$ssl_client_verify",'
'"ssl_protocol": "$ssl_protocol",'
'"ssl_server_name": "$ssl_server_name",'
'"ssl_session_id": "$ssl_session_id",'
'"ssl_session_reused": "$ssl_session_reused"'
'"name": "$ingress_name",'
'"namespace": "$namespace"'
'},'
'"network":'
'{'
'"bytes_written": $body_bytes_sent,'
'"remote_ip": "$remote_addr"'
'},'
'"upstream":'
'{'
'"address": "$upstream_addr", '
'"status": "$upstream_status", '
'"response_time": "$upstream_response_time", '
'"response_length": "$upstream_response_length", '
'"address_list": "$upstream_addr",'
'"status_code": "$upstream_status",'
'"name": "$proxy_upstream_name",'
'"response_time": "$upstream_response_time",'
'"response_length": "$upstream_response_length",'
'"cache_status": "$cache_status"'
'}'
'}';

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$upstream_response_time "$cache_status"';
'$upstream_response_time "$cache_status" "$host" "$upstream_response_length" $request_time';

sendfile on;

Expand Down
Loading