From 362b376acb2707616a912b4a9093d148edf44cad Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Fri, 12 Feb 2016 11:51:33 -0300 Subject: [PATCH] Adds verbose logs to audit logs while deciding or not to save a request --- src/audit_log/audit_log.cc | 9 +++++++++ src/transaction.cc | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/audit_log/audit_log.cc b/src/audit_log/audit_log.cc index eada339b..6430213d 100644 --- a/src/audit_log/audit_log.cc +++ b/src/audit_log/audit_log.cc @@ -228,6 +228,11 @@ bool AuditLog::saveIfRelevant(Transaction *transaction) { bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) { if (this->isRelevant(transaction->m_httpCodeReturned) == false && transaction->m_toBeSavedInAuditlogs == false) { + transaction->debug(5, "Return code `" + + std::to_string(transaction->m_httpCodeReturned) + "'" \ + " is not interesting to audit logs, relevant code(s): `" + + m_relevant + "'."); + return false; } @@ -237,12 +242,16 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) { * */ if (transaction->m_toNotBeSavedInAuditLogs == true) { + transaction->debug(5, "This request was marked to not " \ + "be saved in the audit logs."); return false; } if (parts == -1) { parts = m_parts; } + transaction->debug(5, "Saving this request as part " \ + "of the audit logs."); m_writer->write(transaction, parts); return true; diff --git a/src/transaction.cc b/src/transaction.cc index 6ccaeab4..2f39b58f 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -1213,7 +1213,8 @@ int Transaction::processLogging(int returned_code) { "saved via auditlog action."); } #endif - + debug(8, "Checking if this request is relevant to be " \ + "part of the audit logs."); bool saved = this->m_rules->audit_log->saveIfRelevant(this, parts); if (saved) { #ifndef NO_LOGS