log.conf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # 日志格式定义
  3. # https://nginx.org/en/docs/http/ngx_http_log_module.html
  4. #
  5. # 分隔: tab (\t)
  6. # 前缀: 格式版本。格式变化时递增,方便解析
  7. # 备注:
  8. # _origin_id
  9. # 请求源的别名,参考 allowed-sites.conf
  10. # _ver
  11. # 前端配置的版本,定义于 www/conf.js
  12. # remote_addr
  13. # 用户 IP,目前未考虑 XFF
  14. # _level
  15. # 实验中。记录切换状态(首次请求为 1。切换失败再次请求为 0,表示不接受切换)
  16. # _switched
  17. # 实验中。记录是否切换到廉价节点(未切换则为空,有切换则记录资源体积大小)
  18. # _bodyhash
  19. # 返回内容的 SHA256,用于统计重复内容
  20. # upstream_http_access_control_allow_origin
  21. # 统计 acao = * 的站点,用于加入可直连列表
  22. # _ref
  23. # 请求 referer,不包括 `https://example.com/-----` 部分
  24. # _mode
  25. # 前端 request.mode 属性
  26. # _type
  27. # 前端 request.destination 属性
  28. #
  29. log_format log_proxy escape=none
  30. '02 '
  31. '$time_iso8601 '
  32. '$_origin_id '
  33. '$_ver '
  34. '$remote_addr '
  35. '$_level '
  36. '$_switched '
  37. '$upstream_cache_status '
  38. '$request_time '
  39. '$request_length '
  40. '$bytes_sent '
  41. '$request_method '
  42. '$_url '
  43. '$status '
  44. '$_bodyhash '
  45. '$upstream_http_access_control_allow_origin '
  46. '$http_user_agent '
  47. '$_ref '
  48. '$_mode '
  49. '$_type'
  50. ;
  51. log_format log_www escape=none
  52. '01 '
  53. '$time_iso8601 '
  54. '$remote_addr '
  55. '$request_time '
  56. '$request_method '
  57. '$uri '
  58. '$http_host '
  59. '$status '
  60. '$http_user_agent'
  61. ;