From 5e06a67fbeed5dbee8c8be52d26cd8286e9b2fb8 Mon Sep 17 00:00:00 2001 From: Lasse Karstensen Date: Thu, 27 Jul 2017 14:08:49 +0200 Subject: [PATCH] Demote log lines to improve debug log SNR. The debug logging is verbose and sometimes hard to read. Demote some of the boilerplate output to log level 9, to make it easier to see the important parts on lower verbosity levels. --- src/audit_log/audit_log.cc | 2 +- src/request_body_processor/json.cc | 4 ++-- src/rule.cc | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/audit_log/audit_log.cc b/src/audit_log/audit_log.cc index 93b395a7..24df388d 100644 --- a/src/audit_log/audit_log.cc +++ b/src/audit_log/audit_log.cc @@ -276,7 +276,7 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) { if ((m_status == RelevantOnlyAuditLogStatus && this->isRelevant(transaction->m_httpCodeReturned) == false) && saveAnyway == false) { - transaction->debug(5, "Return code `" + + transaction->debug(9, "Return code `" + std::to_string(transaction->m_httpCodeReturned) + "'" \ " is not interesting to audit logs, relevant code(s): `" + m_relevant + "'."); diff --git a/src/request_body_processor/json.cc b/src/request_body_processor/json.cc index 43195a74..5597e5a1 100644 --- a/src/request_body_processor/json.cc +++ b/src/request_body_processor/json.cc @@ -245,7 +245,7 @@ JSON::JSON(Transaction *transaction) : m_transaction(transaction) { }; - debug(4, "JSON parser initialization"); + debug(9, "JSON parser initialization"); /** * Prefix and current key are initially empty @@ -269,7 +269,7 @@ JSON::JSON(Transaction *transaction) : m_transaction(transaction) { JSON::~JSON() { - debug(4, "JSON: Cleaning up JSON results"); + debug(9, "JSON: Cleaning up JSON results"); yajl_free(m_data.handle); } diff --git a/src/rule.cc b/src/rule.cc index 01b8071e..b426222a 100644 --- a/src/rule.cc +++ b/src/rule.cc @@ -186,7 +186,7 @@ bool Rule::evaluateActions(Transaction *trans) { void Rule::updateMatchedVars(Transaction *trans, std::string key, std::string value) { - trans->debug(4, "Matched vars updated."); + trans->debug(9, "Matched vars updated."); trans->m_variableMatchedVar.set(value, trans->m_variableOffset); trans->m_variableMatchedVarName.set(key, trans->m_variableOffset); @@ -196,7 +196,7 @@ void Rule::updateMatchedVars(Transaction *trans, std::string key, void Rule::cleanMatchedVars(Transaction *trans) { - trans->debug(4, "Matched vars cleaned."); + trans->debug(9, "Matched vars cleaned."); trans->m_variableMatchedVar.unset(); trans->m_variableMatchedVars.unset(); trans->m_variableMatchedVarName.unset(); @@ -254,7 +254,7 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans, for (Action *a : this->m_actionsRuntimePos) { if (a->isDisruptive() == true) { if (a->m_name == "pass") { - trans->debug(4, "Rule contains a `pass' action"); + trans->debug(9, "Rule contains a `pass' action"); } else { *containsDisruptive = true; } @@ -290,7 +290,7 @@ bool Rule::executeOperatorAt(Transaction *trans, std::string key, end = clock(); elapsed_s = static_cast(end - begin) / CLOCKS_PER_SEC; - trans->debug(4, "Operator completed in " + \ + trans->debug(5, "Operator completed in " + \ std::to_string(elapsed_s) + " seconds"); #endif return ret; @@ -625,9 +625,9 @@ void Rule::executeActionsAfterFullMatch(Transaction *trans, } if (a->isDisruptive() == false) { - trans->debug(4, "(SecDefaultAction) Running " \ + trans->debug(9, "(SecDefaultAction) Running " \ "action: " + a->m_name); - a->evaluate(this, trans, ruleMessage); + a->evaluate(this, trans, ruleMessage); continue; }