From fffa84e7567d0c492634537dff5566a9b5e24ab8 Mon Sep 17 00:00:00 2001 From: Miguel Fernandez Date: Sun, 22 Jan 2023 22:34:27 +0100 Subject: [PATCH] Add missing logs from query-engine-node-api --- query-engine/query-engine-node-api/src/logger.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/query-engine/query-engine-node-api/src/logger.rs b/query-engine/query-engine-node-api/src/logger.rs index 383df1fef22c..4ee96f3c1ad3 100644 --- a/query-engine/query-engine-node-api/src/logger.rs +++ b/query-engine/query-engine-node-api/src/logger.rs @@ -31,12 +31,17 @@ impl Logger { enable_metrics: bool, enable_tracing: bool, ) -> Self { - let is_user_facing = filter_fn(telemetry::helpers::user_facing_filter); + let is_sql_query = filter_fn(|meta| { + meta.target() == "quaint::connector::metrics" && meta.fields().iter().any(|f| f.name() == "query") + }); + + // is a mongodb query? + let is_mongo_query = filter_fn(|meta| meta.target() == "mongodb_query_connector::query"); // We need to filter the messages to send to our callback logging mechanism let filters = if log_queries { // Filter trace query events (for query log) or based in the defined log level - is_user_facing.or(log_level).boxed() + is_sql_query.or(is_mongo_query).or(log_level).boxed() } else { // Filter based in the defined log level FilterExt::boxed(log_level)