Log request methods

This commit is contained in:
Antoine Gersant 2025-01-16 00:09:29 -08:00
parent d90b51f752
commit f4009a7fa7

View file

@ -44,7 +44,8 @@ where
}
fn call(&mut self, request: Request) -> Self::Future {
let uri = request.uri().path().to_owned();
let path = request.uri().path().to_owned();
let method = request.method().clone();
let future = self.inner.call(request);
Box::pin(async move {
let response: Response = future.await?;
@ -54,7 +55,7 @@ where
} else {
Level::Info
};
log!(level, "[{}] {}", response.status(), uri);
log!(level, "[{}] {} {}", response.status(), method, path);
Ok(response)
})
}