Log format

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/

The default configuration uses a custom logging format to add additional information about upstreams, response time and status.

log_format upstreaminfo
    '{{ if $cfg.useProxyProtocol }}$proxy_protocol_addr{{ else }}$remote_addr{{ end }} - '
    '[$the_real_ip] - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" "$http_user_agent" '
    '$request_length $request_time [$proxy_upstream_name] $upstream_addr '
    '$upstream_response_length $upstream_response_time $upstream_status';
PlaceholderDescription
$proxy_protocol_addrremote address if proxy protocol is enabled
$remote_addrremote address if proxy protocol is disabled (default)
$the_real_ipthe source IP address of the client
$remote_useruser name supplied with the Basic authentication
$time_locallocal time in the Common Log Format
$requestfull original request line
$statusresponse status
$body_bytes_sentnumber of bytes sent to a client, not counting the response header
$http_referervalue of the Referer header
$http_user_agentvalue of User-Agent header
$request_lengthrequest length (including request line, header, and request body)
$request_timetime elapsed since the first bytes were read from the client
$proxy_upstream_namename of the upstream. The format is upstream-<namespace>-<service name>-<service port>
$upstream_addrthe IP address and port (or the path to the domain socket) of the upstream server. If several servers were contacted during request processing, their addresses are separated by commas.
$upstream_response_lengththe length of the response obtained from the upstream server
$upstream_response_timetime spent on receiving the response from the upstream server as seconds with millisecond resolution
$upstream_statusstatus code of the response obtained from the upstream server

Sources:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值