Nginx自定义日志记录格式

[php]

log_format upstream_response '"$time_local" "$status" $body_bytes_sent "$remote_addr" "$host" "$request" "$upstream_addr"'
'"$http_user_agent" "$request_time" "$upstream_response_time" "$sent_http_location" "$upstream_status" "$http_referer" ';

[/php]

然后在配置中引用

[php]access_log /data/nginx_log/access.log upstream_response buffer=32k;[/php]

Nginx

还没有评论,快来抢沙发!

发表评论

  • 😉
  • 😐
  • 😡
  • 😈
  • 🙂
  • 😯
  • 🙁
  • 🙄
  • 😛
  • 😳
  • 😮
  • emoji-mrgree
  • 😆
  • 💡
  • 😀
  • 👿
  • 😥
  • 😎
  • ➡
  • 😕
  • ❓
  • ❗
  • 67 queries in 0.420 seconds