Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1751 from aledbf/log-upstream-name
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

[nginx-ingress-controller] Add the name of the upstream in the log

fixes #1750
  • Loading branch information
Kubernetes Submit Queue authored Sep 19, 2016
2 parents cd0eaa9 + c3ca28b commit 9b79251
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ingress/controllers/nginx/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ http {

log_format upstreaminfo '{{ if $cfg.useProxyProtocol }}$proxy_protocol_addr{{ else }}$remote_addr{{ end }} - '
'[$proxy_add_x_forwarded_for] - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" '
'$request_length $request_time $upstream_addr $upstream_response_length $upstream_response_time $upstream_status';
'$request_length $request_time [$proxy_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status';

{{/* map urls that should not appear in access.log */}}
{{/* http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log */}}
Expand Down Expand Up @@ -262,6 +262,7 @@ http {
{{- end }}

{{- buildProxyPass $location }}
set $proxy_upstream_name "{{ $location.Upstream.Name }}";
}
{{ end }}

Expand Down

0 comments on commit 9b79251

Please sign in to comment.