diff --git a/Cargo.lock b/Cargo.lock index b9e0d53..3c9bf09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3083,7 +3083,6 @@ dependencies = [ "jsonrpc-pubsub", "jsonrpc-ws-server", "jsonrpsee", - "log", "moka", "opentelemetry", "opentelemetry-datadog", diff --git a/Cargo.toml b/Cargo.toml index 46ddcaa..12f717f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ enumflags2 = "0.7.7" futures = "0.3.25" http = "0.2" hyper = "0.14" -log = "0.4.17" moka = { version = "0.12", features = ["future"] } opentelemetry = { version = "0.21.0" } opentelemetry-datadog = { version = "0.9.0", features = ["reqwest-client"] } @@ -39,9 +38,9 @@ serde_yaml = "0.9.17" tokio = { version = "1.24.2", features = ["full"] } tower = { version = "0.4.13", features = ["full"] } tower-http = { version = "0.4", features = ["full"] } -tracing = "0.1.37" +tracing = "0.1.40" tracing-serde = "0.1.3" -tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] } +tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] } jsonrpsee = { path = "./vendor/jsonrpsee/jsonrpsee", features = ["full"] } governor = { path = "./vendor/governor/governor" } diff --git a/src/config/mod.rs b/src/config/mod.rs index c11095c..9c4d9ad 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -156,7 +156,7 @@ pub fn read_config() -> Result { let mut config: Config = config.into(); if let Ok(endpoints) = std::env::var("ENDPOINTS") { - log::debug!("Override endpoints with env.ENDPOINTS"); + tracing::debug!("Override endpoints with env.ENDPOINTS"); let endpoints = endpoints .split(',') .map(|x| x.trim().to_string()) @@ -171,7 +171,7 @@ pub fn read_config() -> Result { } if let Ok(env_port) = std::env::var("PORT") { - log::debug!("Override port with env.PORT"); + tracing::debug!("Override port with env.PORT"); let port = env_port.parse::(); if let Ok(port) = port { config diff --git a/src/extensions/client/health.rs b/src/extensions/client/health.rs index acdef15..832395b 100644 --- a/src/extensions/client/health.rs +++ b/src/extensions/client/health.rs @@ -64,20 +64,20 @@ impl Health { return; } self.score.store(new_score, Ordering::Relaxed); - log::trace!( + tracing::trace!( "Endpoint {:?} score updated from: {current_score} to: {new_score}", self.url ); // Notify waiters if the score has dropped below the threshold if current_score >= THRESHOLD && new_score < THRESHOLD { - log::warn!("Endpoint {:?} became unhealthy", self.url); + tracing::warn!("Endpoint {:?} became unhealthy", self.url); self.unhealthy.notify_waiters(); } } pub fn on_error(&self, err: &jsonrpsee::core::Error) { - log::warn!("Endpoint {:?} responded with error: {err:?}", self.url); + tracing::warn!("Endpoint {:?} responded with error: {err:?}", self.url); match err { jsonrpsee::core::Error::RequestTimeout => { self.update(Event::RequestTimeout); diff --git a/src/extensions/telemetry/mod.rs b/src/extensions/telemetry/mod.rs index 4426deb..c046f3c 100644 --- a/src/extensions/telemetry/mod.rs +++ b/src/extensions/telemetry/mod.rs @@ -51,7 +51,7 @@ impl Telemetry { pub fn setup_telemetry(options: &TelemetryConfig) -> Result, TraceError> { global::set_error_handler(|e| { - log::warn!("OpenTelemetry error: {}", e); + tracing::warn!("OpenTelemetry error: {}", e); }) .expect("failed to set OpenTelemetry error handler"); diff --git a/src/middlewares/methods/block_tag.rs b/src/middlewares/methods/block_tag.rs index b71b1ba..ed8e657 100644 --- a/src/middlewares/methods/block_tag.rs +++ b/src/middlewares/methods/block_tag.rs @@ -94,7 +94,7 @@ impl BlockTagMiddleware { }; if let Some(value) = maybe_value { - log::trace!( + tracing::trace!( "Replacing params {:?} updated with {:?}", request.params, (self.index, &value),