From 1d05bc5e89cd5b1a5122cf79e565f4002ebb5b49 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 8 Jun 2023 11:26:09 -0700 Subject: [PATCH] lower log levels --- web3_proxy/src/errors.rs | 8 ++++---- web3_proxy/src/frontend/users/authentication.rs | 4 ++-- web3_proxy/src/frontend/users/subuser.rs | 2 +- web3_proxy/src/stats/influxdb_queries.rs | 17 +++++++++-------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/web3_proxy/src/errors.rs b/web3_proxy/src/errors.rs index 84771670..7ac37da2 100644 --- a/web3_proxy/src/errors.rs +++ b/web3_proxy/src/errors.rs @@ -773,7 +773,7 @@ impl Web3ProxyError { ) } Self::RefererRequired => { - warn!("referer required"); + debug!("referer required"); ( StatusCode::BAD_REQUEST, JsonRpcErrorData { @@ -784,7 +784,7 @@ impl Web3ProxyError { ) } Self::RefererNotAllowed(referer) => { - warn!("referer not allowed referer={:?}", referer); + debug!("referer not allowed referer={:?}", referer); ( StatusCode::FORBIDDEN, JsonRpcErrorData { @@ -898,7 +898,7 @@ impl Web3ProxyError { }, ), Self::UserAgentRequired => { - warn!("UserAgentRequired"); + debug!("UserAgentRequired"); ( StatusCode::BAD_REQUEST, JsonRpcErrorData { @@ -909,7 +909,7 @@ impl Web3ProxyError { ) } Self::UserAgentNotAllowed(ua) => { - warn!("UserAgentNotAllowed ua={}", ua); + debug!("UserAgentNotAllowed ua={}", ua); ( StatusCode::FORBIDDEN, JsonRpcErrorData { diff --git a/web3_proxy/src/frontend/users/authentication.rs b/web3_proxy/src/frontend/users/authentication.rs index cb51fb67..e7ce6546 100644 --- a/web3_proxy/src/frontend/users/authentication.rs +++ b/web3_proxy/src/frontend/users/authentication.rs @@ -314,7 +314,7 @@ pub async fn user_login_post( debug!("Refferal code is: {:?}", payload.referral_code); if let Some(referral_code) = payload.referral_code.as_ref() { // If it is not inside, also check in the database - warn!("Using register referral code: {:?}", referral_code); + trace!("Using register referral code: {:?}", referral_code); let user_referrer = referrer::Entity::find() .filter(referrer::Column::ReferralCode.eq(referral_code)) .one(db_replica.as_ref()) @@ -345,7 +345,7 @@ pub async fn user_login_post( // First, optionally catch a referral code from the parameters if there is any if let Some(referral_code) = payload.referral_code.as_ref() { // If it is not inside, also check in the database - warn!("Using referral code: {:?}", referral_code); + trace!("Using referral code: {:?}", referral_code); let user_referrer = referrer::Entity::find() .filter(referrer::Column::ReferralCode.eq(referral_code)) .one(db_replica.as_ref()) diff --git a/web3_proxy/src/frontend/users/subuser.rs b/web3_proxy/src/frontend/users/subuser.rs index 317d121d..81597444 100644 --- a/web3_proxy/src/frontend/users/subuser.rs +++ b/web3_proxy/src/frontend/users/subuser.rs @@ -145,7 +145,7 @@ pub async fn get_subusers( .all(db_replica.as_ref()) .await?; - warn!("Subusers are: {:?}", subusers); + trace!("Subusers are: {:?}", subusers); // Now return the list let response_json = json!({ diff --git a/web3_proxy/src/stats/influxdb_queries.rs b/web3_proxy/src/stats/influxdb_queries.rs index e9fda7d2..370f2523 100644 --- a/web3_proxy/src/stats/influxdb_queries.rs +++ b/web3_proxy/src/stats/influxdb_queries.rs @@ -146,7 +146,7 @@ pub async fn query_user_stats<'a>( .clone() .context("No influxdb bucket was provided")?; // "web3_proxy"; - info!("Bucket is {:?}", bucket); + trace!("Bucket is {:?}", bucket); let mut filter_chain_id = "".to_string(); if chain_id != 0 { filter_chain_id = f!(r#"|> filter(fn: (r) => r["chain_id"] == "{chain_id}")"#); @@ -154,14 +154,15 @@ pub async fn query_user_stats<'a>( // Fetch and request for balance - info!( + trace!( "Query start and stop are: {:?} {:?}", - query_start, query_stop + query_start, + query_stop ); // info!("Query column parameters are: {:?}", stats_column); - info!("Query measurement is: {:?}", measurement); - info!("Filters are: {:?}", filter_chain_id); // filter_field - info!("window seconds are: {:?}", query_window_seconds); + trace!("Query measurement is: {:?}", measurement); + trace!("Filters are: {:?}", filter_chain_id); // filter_field + trace!("window seconds are: {:?}", query_window_seconds); let drop_method = match stat_response_type { StatType::Aggregated => f!(r#"|> drop(columns: ["method"])"#), @@ -190,9 +191,9 @@ pub async fn query_user_stats<'a>( |> sort(columns: ["_time", "_measurement", "archive_needed", "chain_id", "error_response", "method", "rpc_secret_key_id"], desc: true) "#); - info!("Raw query to db is: {:?}", query); + debug!("Raw query to db is: {:?}", query); let query = Query::new(query.to_string()); - info!("Query to db is: {:?}", query); + trace!("Query to db is: {:?}", query); // Make the query and collect all data let raw_influx_responses: Vec = influxdb_client