Adds option to disable logging of stopwatches in audit log.

This commit is contained in:
Marc Stern
2017-05-02 17:11:11 -03:00
committed by Felipe Zimmerle
parent 41ae8db571
commit 7246998f09
3 changed files with 28 additions and 1 deletions

View File

@@ -1165,6 +1165,9 @@ void sec_audit_logger_json(modsec_rec *msr) {
/* Stopwatch2 */
#ifdef DLOG_NO_STOPWATCH
if (msr->txcfg->debuglog_level >= 9)
#endif
format_performance_variables_json(msr, g);
/* Our response body does not contain chunks */
@@ -1989,6 +1992,9 @@ void sec_audit_logger_native(modsec_rec *msr) {
}
/* Stopwatch; left in for compatibility reasons */
#ifdef DLOG_NO_STOPWATCH
if (msr->txcfg->debuglog_level >= 9) {
#endif
text = apr_psprintf(msr->mp, "Stopwatch: %" APR_TIME_T_FMT " %" APR_TIME_T_FMT " (- - -)\n",
msr->request_time, (now - msr->request_time));
sec_auditlog_write(msr, text, strlen(text));
@@ -2001,6 +2007,9 @@ void sec_audit_logger_native(modsec_rec *msr) {
"; %s\n", msr->request_time, (now - msr->request_time), perf_all);
sec_auditlog_write(msr, text, strlen(text));
}
#ifdef DLOG_NO_STOPWATCH
}
#endif
/* Our response body does not contain chunks */
/* ENH Only write this when the output was chunked. */