Allow sending logs to stdout by using STDOUT_LOG env var (#334)

* Allow sending logs to stdout by using STDOUT_LOG env var

* Increase stats buffer size
This commit is contained in:
Jose Fernández
2023-02-28 22:10:40 +01:00
committed by GitHub
parent eb8cfdb1f1
commit 9241df18e2
3 changed files with 84 additions and 2 deletions

View File

@@ -66,6 +66,7 @@ mod config;
mod constants;
mod errors;
mod messages;
mod multi_logger;
mod pool;
mod prometheus;
mod query_router;
@@ -81,7 +82,7 @@ use crate::prometheus::start_metric_server;
use crate::stats::{Collector, Reporter, REPORTER};
fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::builder().format_timestamp_micros().init();
multi_logger::MultiLogger::init().unwrap();
info!("Welcome to PgCat! Meow. (Version {})", VERSION);
@@ -160,7 +161,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let client_server_map: ClientServerMap = Arc::new(Mutex::new(HashMap::new()));
// Statistics reporting.
let (stats_tx, stats_rx) = mpsc::channel(100_000);
let (stats_tx, stats_rx) = mpsc::channel(500_000);
REPORTER.store(Arc::new(Reporter::new(stats_tx.clone())));
// Connection pool that allows to query all shards and replicas.