Selectively disabling logging
To make sure that certain rules do not trigger logging, we can use the nolog
and noauditlog
directives. The nolog
directive causes a match of the current rule to not be considered a criterion for writing log data either to the Apache error log or the ModSecurity audit log. Similarly, the noauditlog
directive causes a match of the current rule to not be considered a criterion for recording the request in the audit log.
For both the nolog
and noauditlog
directives, a rule that has matched before or after the current rule can still trigger logging for the transaction. To disable logging for all rules in a transaction, use the directive ctl:auditEngine=off
.