Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7246998

Browse files
Marc SternFelipe Zimmerle
Marc Stern
authored and
Felipe Zimmerle
committed
Adds option to disable logging of stopwatches in audit log.
1 parent41ae8db commit7246998

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

‎CHANGES‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
DD MMM YYYY - 2.9.2 - To be released
22
------------------------------------
33

4+
* {dis|en}able-stopwatch-logging: Option to disable logging of stopwatches
5+
in audit log.
6+
[Issue #1067 - Marc Stern]
47
* {dis|en}able-dechunk-logging: Option to disable logging of
58
dechunking in audit log when log level < 9.
69
* Updates libinjection to: da027ab52f9cf14401dd92e34e6683d183bdb3b4

‎apache2/msc_logging.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,9 @@ void sec_audit_logger_json(modsec_rec *msr) {
11651165

11661166

11671167
/* Stopwatch2 */
1168+
#ifdefDLOG_NO_STOPWATCH
1169+
if (msr->txcfg->debuglog_level >=9)
1170+
#endif
11681171
format_performance_variables_json(msr,g);
11691172

11701173
/* Our response body does not contain chunks */
@@ -1989,6 +1992,9 @@ void sec_audit_logger_native(modsec_rec *msr) {
19891992
}
19901993

19911994
/* Stopwatch; left in for compatibility reasons */
1995+
#ifdefDLOG_NO_STOPWATCH
1996+
if (msr->txcfg->debuglog_level >=9) {
1997+
#endif
19921998
text=apr_psprintf(msr->mp,"Stopwatch: %"APR_TIME_T_FMT" %"APR_TIME_T_FMT" (- - -)\n",
19931999
msr->request_time, (now-msr->request_time));
19942000
sec_auditlog_write(msr,text,strlen(text));
@@ -2001,6 +2007,9 @@ void sec_audit_logger_native(modsec_rec *msr) {
20012007
"; %s\n",msr->request_time, (now-msr->request_time),perf_all);
20022008
sec_auditlog_write(msr,text,strlen(text));
20032009
}
2010+
#ifdefDLOG_NO_STOPWATCH
2011+
}
2012+
#endif
20042013

20052014
/* Our response body does not contain chunks */
20062015
/* ENH Only write this when the output was chunked. */

‎configure.ac‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,21 @@ AC_ARG_ENABLE(dechunk-logging,
502502
log_dechunk=''
503503
])
504504

505+
# Disable logging of stopwatches
506+
AC_ARG_ENABLE(stopwatch-logging,
507+
AS_HELP_STRING([--enable-stopwatch-logging],
508+
[Enable logging of stopwatches in audit log when log level < 9. This is the default]),
509+
[
510+
if test "$enableval" != "no"; then
511+
log_stopwatch=
512+
else
513+
log_stopwatch="-DLOG_NO_STOPWATCH"
514+
fi
515+
],
516+
[
517+
log_stopwatch=''
518+
])
519+
505520
# Ignore configure errors
506521
AC_ARG_ENABLE(errors,
507522
AS_HELP_STRING([--disable-errors],
@@ -752,7 +767,7 @@ else
752767
fi
753768
fi
754769

755-
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"
770+
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"
756771

757772
APXS_WRAPPER=build/apxs-wrapper
758773
APXS_EXTRA_CFLAGS=""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp