Adds option to disable logging of stopwatches in audit log.
This commit is contained in:
Родитель
41ae8db571
Коммит
7246998f09
3
CHANGES
3
CHANGES
|
@ -1,6 +1,9 @@
|
|||
DD MMM YYYY - 2.9.2 - To be released
|
||||
------------------------------------
|
||||
|
||||
* {dis|en}able-stopwatch-logging: Option to disable logging of stopwatches
|
||||
in audit log.
|
||||
[Issue #1067 - Marc Stern]
|
||||
* {dis|en}able-dechunk-logging: Option to disable logging of
|
||||
dechunking in audit log when log level < 9.
|
||||
* Updates libinjection to: da027ab52f9cf14401dd92e34e6683d183bdb3b4
|
||||
|
|
|
@ -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. */
|
||||
|
|
17
configure.ac
17
configure.ac
|
@ -502,6 +502,21 @@ AC_ARG_ENABLE(dechunk-logging,
|
|||
log_dechunk=''
|
||||
])
|
||||
|
||||
# Disable logging of stopwatches
|
||||
AC_ARG_ENABLE(stopwatch-logging,
|
||||
AS_HELP_STRING([--enable-stopwatch-logging],
|
||||
[Enable logging of stopwatches in audit log when log level < 9. This is the default]),
|
||||
[
|
||||
if test "$enableval" != "no"; then
|
||||
log_stopwatch=
|
||||
else
|
||||
log_stopwatch="-DLOG_NO_STOPWATCH"
|
||||
fi
|
||||
],
|
||||
[
|
||||
log_stopwatch=''
|
||||
])
|
||||
|
||||
# Ignore configure errors
|
||||
AC_ARG_ENABLE(errors,
|
||||
AS_HELP_STRING([--disable-errors],
|
||||
|
@ -752,7 +767,7 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem $log_dechunk"
|
||||
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem $log_dechunk $log_stopwatch"
|
||||
|
||||
APXS_WRAPPER=build/apxs-wrapper
|
||||
APXS_EXTRA_CFLAGS=""
|
||||
|
|
Загрузка…
Ссылка в новой задаче