From f3a8afc7d456297b483025c25c58cf8b1ddfbd2a Mon Sep 17 00:00:00 2001 From: Ganesh Murthy Date: Thu, 28 Sep 2023 14:33:31 -0400 Subject: [PATCH] Log record_type VFLOW_RECORD_FLOW at DEBUG level and the rest of the record types at INFO level --- src/vanflow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vanflow.c b/src/vanflow.c index b75926a66..ff66fabfd 100644 --- a/src/vanflow.c +++ b/src/vanflow.c @@ -772,6 +772,9 @@ static char *_vflow_unserialize_identity(qd_parsed_field_t *field) */ static void _vflow_emit_record_as_log_TH(vflow_record_t *record) { + qd_log_level_t log_level = record->record_type == VFLOW_RECORD_FLOW ? QD_LOG_DEBUG : QD_LOG_INFO; + if (!qd_log_enabled(LOG_FLOW_LOG, log_level)) + return; #define LINE_MAX 1000 char line[LINE_MAX + 1]; @@ -798,7 +801,7 @@ static void _vflow_emit_record_as_log_TH(vflow_record_t *record) } record->never_logged = false; - qd_log(LOG_FLOW_LOG, QD_LOG_INFO, "%s", line); + qd_log(LOG_FLOW_LOG, log_level, "%s", line); }