diff --git a/core/lib/Cargo.toml b/core/lib/Cargo.toml
index b37254b14a..a29047041f 100644
--- a/core/lib/Cargo.toml
+++ b/core/lib/Cargo.toml
@@ -20,6 +20,7 @@ rust-version = "1.75"
all-features = true
[lints.rust]
+unexpected_cfgs = "allow"
rust_2018_idioms = "warn"
# missing_docs = "warn"
async_fn_in_trait = "allow"
@@ -42,7 +43,7 @@ uuid = ["uuid_", "rocket_http/uuid"]
tls = ["rustls", "tokio-rustls", "rustls-pemfile"]
mtls = ["tls", "x509-parser"]
tokio-macros = ["tokio/macros"]
-trace = ["tracing-subscriber", "tinyvec", "rustls?/logging", "tokio-rustls?/logging", "multer/log"]
+trace = ["tracing-subscriber", "tinyvec", "thread_local", "rustls?/logging", "tokio-rustls?/logging", "multer/log"]
[dependencies]
# Optional serialization dependencies.
@@ -87,6 +88,7 @@ state = "0.6"
# tracing
tracing = { version = "0.1.40", default-features = false, features = ["std", "attributes"] }
tinyvec = { version = "1.6", optional = true, features = ["std", "rustc_1_57"] }
+thread_local = { version = "1.1", optional = true }
[dependencies.tracing-subscriber]
version = "0.3.18"
diff --git a/core/lib/src/trace/mod.rs b/core/lib/src/trace/mod.rs
index 4a160a4aaf..1f0bb2344f 100644
--- a/core/lib/src/trace/mod.rs
+++ b/core/lib/src/trace/mod.rs
@@ -1,5 +1,3 @@
-use rocket::Config;
-
#[macro_use]
pub mod macros;
#[cfg(feature = "trace")]
@@ -7,7 +5,10 @@ pub mod subscriber;
pub mod level;
pub mod traceable;
-pub fn init<'a, T: Into