Skip to main content

log_http_error

Function log_http_error 

Source
pub fn log_http_error(
    method: &str,
    path: &str,
    status: u16,
    body: &str,
    member_id: Option<i32>,
)
Expand description

记录 HTTP 4xx/5xx 响应

error_log_middleware 在每次响应 status >= 400 时调用。

§参数

  • method: HTTP 方法
  • path: 请求路径(经 api_request_path() 还原后的完整路径)
  • status: HTTP 状态码
  • body: 响应 body(会被截断至 512 字符)
  • member_id: 当前登录组员 ID(未登录为 None)