Skip to content

Commit

Permalink
Add missing logs from query-engine-node-api
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Jan 22, 2023
1 parent 1895339 commit 6970951
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions query-engine/query-engine-node-api/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6970951

Please sign in to comment.