- update: logging system to only show logs from the app and not any 3rd party dependencies
This commit is contained in:
@@ -13,7 +13,7 @@ tokio = { version = "1.41.1", features = ["full"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
bytes = { version = "1.8.0", features = ["std", "serde"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.3.18"
|
||||
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "chrono"] }
|
||||
bincode = { version = "2.0.0", features = ["derive", "serde"] }
|
||||
thiserror = "2.0.3"
|
||||
lazy_static = "1.5.0"
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user