mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
Log HTTP Not Found (404) as info log level. (#3119)
This commit is contained in:
parent
68119e1067
commit
a0944b8601
|
@ -1,6 +1,6 @@
|
||||||
//! Reimplementation of tower-http's DefaultMakeSpan that only runs at "INFO" level for our own needs.
|
//! Reimplementation of tower-http's DefaultMakeSpan that only runs at "INFO" level for our own needs.
|
||||||
|
|
||||||
use axum::http::Request;
|
use axum::http::{Request, StatusCode};
|
||||||
use kanidm_proto::constants::KOPID;
|
use kanidm_proto::constants::KOPID;
|
||||||
use sketching::event_dynamic_lvl;
|
use sketching::event_dynamic_lvl;
|
||||||
use tower_http::LatencyUnit;
|
use tower_http::LatencyUnit;
|
||||||
|
@ -83,7 +83,11 @@ impl<B> tower_http::trace::OnResponse<B> for DefaultOnResponseKanidmd {
|
||||||
if response.status().is_redirection() {
|
if response.status().is_redirection() {
|
||||||
(Level::INFO, "client redirection sent")
|
(Level::INFO, "client redirection sent")
|
||||||
} else if response.status().is_client_error() {
|
} else if response.status().is_client_error() {
|
||||||
(Level::WARN, "client error") // it worked, but there was an input error
|
if response.status() == StatusCode::NOT_FOUND {
|
||||||
|
(Level::INFO, "client error")
|
||||||
|
} else {
|
||||||
|
(Level::WARN, "client error") // it worked, but there was an input error
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
(Level::ERROR, "error handling request") // oh no the server failed
|
(Level::ERROR, "error handling request") // oh no the server failed
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue