- update: logging system to only show logs from the app and not any 3rd party dependencies
This commit is contained in:
@@ -15,7 +15,7 @@ chrono = { version = "0.4.39", features = ["serde"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
dotenv = "0.15"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "chrono"] }
|
||||
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "chrono"] }
|
||||
prost = "0.13.3"
|
||||
serde_json = "1.0.133"
|
||||
async-trait = "0.1.83"
|
||||
|
||||
@@ -11,17 +11,15 @@ use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use tonic::transport::Server;
|
||||
use tracing::{info, Level};
|
||||
use tracing_subscriber::EnvFilter;
|
||||
use utils::logging;
|
||||
use utils::redis_cache::RedisCache;
|
||||
|
||||
#[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);
|
||||
|
||||
let addr = env::var("LISTEN_ADDR").unwrap_or_else(|_| "0.0.0.0".to_string());
|
||||
let port = env::var("SERVICE_PORT").unwrap_or_else(|_| "50052".to_string());
|
||||
|
||||
Reference in New Issue
Block a user