diff --git a/auction-server/src/main.rs b/auction-server/src/main.rs index ce0bd8bb..d4e00ecf 100644 --- a/auction-server/src/main.rs +++ b/auction-server/src/main.rs @@ -17,6 +17,7 @@ use { io::IsTerminal, time::Duration, }, + tracing::Metadata, tracing_subscriber::{ filter::{ self, @@ -40,6 +41,10 @@ mod server; mod state; mod subwallet; +fn is_internal(metadata: &Metadata) -> bool { + metadata.target().starts_with("auction_server") +} + #[tokio::main] async fn main() -> Result<()> { // Initialize a Tracing Subscriber @@ -71,7 +76,7 @@ async fn main() -> Result<()> { let registry = tracing_subscriber::registry() .with(MetricsLayer.with_filter(filter::filter_fn(is_metrics))) .with(telemetry.with_filter(filter::filter_fn(|metadata| { - !is_metrics(metadata) && metadata.target().starts_with("auction_server") + !is_metrics(metadata) && is_internal(metadata) }))); if std::io::stderr().is_terminal() { @@ -80,7 +85,9 @@ async fn main() -> Result<()> { log_layer .compact() .with_filter(LevelFilter::INFO) - .with_filter(filter::filter_fn(|metadata| !is_metrics(metadata))), + .with_filter(filter::filter_fn(|metadata| { + !is_metrics(metadata) && is_internal(metadata) + })), ) .init(); } else { @@ -89,7 +96,9 @@ async fn main() -> Result<()> { log_layer .json() .with_filter(LevelFilter::INFO) - .with_filter(filter::filter_fn(|metadata| !is_metrics(metadata))), + .with_filter(filter::filter_fn(|metadata| { + !is_metrics(metadata) && is_internal(metadata) + })), ) .init(); } diff --git a/auction-server/src/opportunity/service/get_spoof_info.rs b/auction-server/src/opportunity/service/get_spoof_info.rs index a270a512..0a1b0f4e 100644 --- a/auction-server/src/opportunity/service/get_spoof_info.rs +++ b/auction-server/src/opportunity/service/get_spoof_info.rs @@ -35,7 +35,7 @@ impl Service { let result = find_spoof_info(input.token, Arc::new(config.provider.clone())) .await .unwrap_or_else(|e| { - tracing::error!("Error finding spoof info: {:?}", e); + tracing::warn!(error = ?e, "Couldn't find spoof info"); entities::SpoofInfo { token: input.token, state: entities::SpoofState::UnableToSpoof, diff --git a/auction-server/src/opportunity/service/handle_opportunity_bid.rs b/auction-server/src/opportunity/service/handle_opportunity_bid.rs index 56a7486f..1fb56dd2 100644 --- a/auction-server/src/opportunity/service/handle_opportunity_bid.rs +++ b/auction-server/src/opportunity/service/handle_opportunity_bid.rs @@ -109,11 +109,11 @@ impl Service { { Ok(bid) => Ok(bid.id), Err(e) => { - tracing::error!( + tracing::warn!( error = ?e, opportunity = ?opportunity, bid_create = ?bid_create, - "Error handling bid", + "Handling bid failed for opportunity_bid", ); match e { RestError::SimulationError { result, reason } => {