mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
Adding some extra fields to logging on-request (#595)
This commit is contained in:
parent
bfea182a89
commit
b0542c7e54
|
@ -48,13 +48,23 @@ impl TreeMiddleware {
|
|||
}
|
||||
req.set_ext(TreeMiddlewareFinished);
|
||||
|
||||
let path = req.url().path().to_string();
|
||||
let remote_address = req.remote().unwrap_or("-").to_string();
|
||||
let host = req.host().unwrap_or("-").to_string();
|
||||
let method = req.method();
|
||||
let path = req.url().path().to_string();
|
||||
|
||||
let path = path.as_str();
|
||||
let remote_address = remote_address.as_str();
|
||||
let host = host.as_str();
|
||||
let method = method.as_ref();
|
||||
let path = path.as_str();
|
||||
|
||||
request_info!(http.method = method, path, "Request received");
|
||||
request_info!(
|
||||
src = remote_address,
|
||||
http.host = host,
|
||||
http.method = method,
|
||||
path,
|
||||
"Request received"
|
||||
);
|
||||
|
||||
let response = next.run(req).await;
|
||||
let status = response.status();
|
||||
|
|
Loading…
Reference in a new issue