mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
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.
This commit is contained in:
committed by
Felipe Zimmerle
parent
5c7892ce89
commit
5e06a67fbe
@@ -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 + "'.");
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
12
src/rule.cc
12
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<double>(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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user