Log improvement
This commit is contained in:
parent
af97b37e51
commit
44e7ec1527
1 changed files with 6 additions and 10 deletions
|
@ -1,5 +1,4 @@
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
use tracing_subscriber::fmt::writer::MakeWriterExt;
|
|
||||||
use tracing_subscriber::layer::SubscriberExt;
|
use tracing_subscriber::layer::SubscriberExt;
|
||||||
use tracing_subscriber::util::SubscriberInitExt;
|
use tracing_subscriber::util::SubscriberInitExt;
|
||||||
|
|
||||||
|
@ -17,16 +16,13 @@ pub fn init_axum(max_level: Level) {
|
||||||
// axum logs rejections from built-in extractors with the `axum::rejection`
|
// axum logs rejections from built-in extractors with the `axum::rejection`
|
||||||
// target, at `TRACE` level. `axum::rejection=trace` enables showing those events
|
// target, at `TRACE` level. `axum::rejection=trace` enables showing those events
|
||||||
format!(
|
format!(
|
||||||
"{}=debug,tower_http=debug,axum::rejection=trace",
|
"{}={},tower_http={},axum::rejection=trace",
|
||||||
env!("CARGO_CRATE_NAME")
|
env!("CARGO_CRATE_NAME"),
|
||||||
)
|
max_level.as_str(),
|
||||||
.into()
|
max_level.as_str()
|
||||||
|
).into()
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.with(
|
.with(tracing_subscriber::fmt::layer().with_target(false))
|
||||||
tracing_subscriber::fmt::layer()
|
|
||||||
.with_writer(std::io::stdout.with_max_level(max_level))
|
|
||||||
.with_target(false)
|
|
||||||
)
|
|
||||||
.init();
|
.init();
|
||||||
}
|
}
|
Loading…
Reference in a new issue