nignx日志格式

时间:2021-02-12 14:30:31

web-master的nginx格式:

log_format      web_format   '$remote_addr $remote_port $remote_user [$time_local]  '
'"$request_method $scheme://$host$request_uri $server_protocol" $status $body_bytes_sent '
'reqtime:$request_time uptime:$upstream_response_time "$http_referer" '
'"$http_user_agent" "$http_cookie" $upstream_addr $sent_http_x_cache';

api-master的nginx日志格式:

log_format    api_format   '$remote_addr - $remote_user [$time_local]  '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'reqtime=$request_time uptime=$upstream_response_time email=$uid $upstream_addr';

post请求的日志格式:

log_format      post_format   '$remote_addr - $remote_user [$time_local]  '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'$request_time $upstream_response_time $upstream_addr $request_body';