- update: logging system to only show logs from the app and not any 3rd party dependencies

This commit is contained in:
2025-03-19 02:13:02 -04:00
parent 03cef8e526
commit 98b8d412e7
16 changed files with 57 additions and 61 deletions

View File

@@ -20,7 +20,8 @@ use tokio::sync::{Mutex, Semaphore};
use tokio::{select, signal};
use tracing::Level;
use tracing::{debug, error, info, warn};
use utils::consul_registration;
use tracing_subscriber::EnvFilter;
use utils::{consul_registration, logging};
use utils::service_discovery::{get_kube_service_endpoints_by_dns};
use warp::Filter;
@@ -58,12 +59,8 @@ const MAX_CONCURRENT_CONNECTIONS: usize = 100;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
dotenv().ok();
tracing_subscriber::fmt()
.with_max_level(
Level::from_str(&env::var("LOG_LEVEL").unwrap_or_else(|_| "info".to_string()))
.unwrap_or_else(|_| Level::INFO),
)
.init();
let app_name = env!("CARGO_PKG_NAME");
logging::setup_logging(app_name);
// Set the gRPC server address
let addr = env::var("LISTEN_ADDR").unwrap_or_else(|_| "0.0.0.0".to_string());