mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
refactor: include binary name in service field in log entries (#2077)
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
#[doc(inline)]
|
||||
pub use router_env::*;
|
||||
|
||||
pub mod logger {
|
||||
#[doc(inline)]
|
||||
pub use router_env::{log, logger::*};
|
||||
|
||||
/// Setup logging sub-system
|
||||
pub fn setup(conf: &config::Log) -> TelemetryGuard {
|
||||
router_env::setup(
|
||||
conf,
|
||||
router_env::service_name!(),
|
||||
[router_env::service_name!()],
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
mod connection;
|
||||
pub mod env;
|
||||
pub mod errors;
|
||||
pub mod logger;
|
||||
pub(crate) mod metrics;
|
||||
pub mod services;
|
||||
pub mod settings;
|
||||
@ -9,7 +9,6 @@ use std::sync::{atomic, Arc};
|
||||
|
||||
use common_utils::signals::get_allowed_signals;
|
||||
use diesel_models::kv;
|
||||
pub use env as logger;
|
||||
use error_stack::{IntoReport, ResultExt};
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
|
||||
2
crates/drainer/src/logger.rs
Normal file
2
crates/drainer/src/logger.rs
Normal file
@ -0,0 +1,2 @@
|
||||
#[doc(inline)]
|
||||
pub use router_env::*;
|
||||
@ -20,7 +20,11 @@ async fn main() -> DrainerResult<()> {
|
||||
let shutdown_intervals = conf.drainer.shutdown_interval;
|
||||
let loop_interval = conf.drainer.loop_interval;
|
||||
|
||||
let _guard = logger::setup(&conf.log);
|
||||
let _guard = router_env::setup(
|
||||
&conf.log,
|
||||
router_env::service_name!(),
|
||||
[router_env::service_name!()],
|
||||
);
|
||||
|
||||
logger::info!("Drainer started [{:?}] [{:?}]", conf.drainer, conf.log);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user