use tracing_subscriber::{ prelude::__tracing_subscriber_SubscriberExt, util::SubscriberInitExt, Layer, }; pub fn init_subscriber() { let log_filter = tracing_subscriber::filter::Targets::new() .with_default(tracing::Level::INFO) .with_target("tokio", tracing::Level::WARN) .with_target("axum", tracing::Level::WARN) .with_target("axum_keycloak_auth", tracing::Level::DEBUG) .with_target("runtime", tracing::Level::WARN); let fmt_layer = tracing_subscriber::fmt::layer() .pretty() .with_file(true) .with_line_number(true) .with_ansi(true) .with_thread_names(false) .with_thread_ids(false); let fmt_layer_filtered = fmt_layer.with_filter(log_filter); tracing_subscriber::Registry::default() .with(fmt_layer_filtered) .init(); }