server: rest: also log the query part of URL
As it is part of the request and we do so in our other products Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4703ba81ce
commit
400c568f8e
|
@ -111,7 +111,7 @@ pub struct ApiService {
|
||||||
fn log_response(
|
fn log_response(
|
||||||
peer: &std::net::SocketAddr,
|
peer: &std::net::SocketAddr,
|
||||||
method: hyper::Method,
|
method: hyper::Method,
|
||||||
path: &str,
|
path_query: &str,
|
||||||
resp: &Response<Body>,
|
resp: &Response<Body>,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ fn log_response(
|
||||||
|
|
||||||
// we also log URL-to-long requests, so avoid message bigger than PIPE_BUF (4k on Linux)
|
// we also log URL-to-long requests, so avoid message bigger than PIPE_BUF (4k on Linux)
|
||||||
// to profit from atomicty guarantees for O_APPEND opened logfiles
|
// to profit from atomicty guarantees for O_APPEND opened logfiles
|
||||||
let path = &path[..MAX_URI_QUERY_LENGTH.min(path.len())];
|
let path = &path_query[..MAX_URI_QUERY_LENGTH.min(path_query.len())];
|
||||||
|
|
||||||
let status = resp.status();
|
let status = resp.status();
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ impl tower_service::Service<Request<Body>> for ApiService {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call(&mut self, req: Request<Body>) -> Self::Future {
|
fn call(&mut self, req: Request<Body>) -> Self::Future {
|
||||||
let path = req.uri().path().to_owned();
|
let path = req.uri().path_and_query().unwrap().as_str().to_owned();
|
||||||
let method = req.method().clone();
|
let method = req.method().clone();
|
||||||
|
|
||||||
let config = Arc::clone(&self.api_config);
|
let config = Arc::clone(&self.api_config);
|
||||||
|
|
Loading…
Reference in New Issue