add access_log_env_var for apache vhost

Allows to only requests with particular environment variables be logged.
Example: set a dontlog variable for healthchecks, so healthchecks are not
logged.

Change-Id: I4dea75f85d2e4a2287bdcce845c4b5fa05da0ddc
This commit is contained in:
Benedikt Trefzer 2023-11-07 17:25:41 +01:00
parent 4552c7d2de
commit d5e5473f93
2 changed files with 7 additions and 0 deletions

View File

@ -218,6 +218,9 @@
# (Optional) The log format for the virtualhost.
# Defaults to undef
#
# [*access_log_env_var*]
# (Optional) Specifies that only requests with particular environment variables be logged.
#
# [*error_log_file*]
# (Optional) The error log file name for the virtualhost.
# error_log_file and error_log_pipe is mutually exclusive.
@ -280,6 +283,7 @@ define openstacklib::wsgi::apache (
$access_log_pipe = undef,
$access_log_syslog = undef,
$access_log_format = undef,
$access_log_env_var = undef,
$error_log_file = undef,
$error_log_pipe = undef,
$error_log_syslog = undef,
@ -387,6 +391,7 @@ define openstacklib::wsgi::apache (
access_log_pipe => $access_log_pipe,
access_log_syslog => $access_log_syslog,
access_log_format => $access_log_format,
access_log_env_var => $access_log_env_var,
error_log_file => $error_log_file,
error_log_pipe => $error_log_pipe,
error_log_syslog => $error_log_syslog,

View File

@ -114,6 +114,7 @@ describe 'openstacklib::wsgi::apache' do
:access_log_file => '/var/log/httpd/access_log',
:access_log_syslog => 'syslog:local0',
:access_log_format => 'some format',
:access_log_env_var => 'dontlog=1',
:error_log_file => '/var/log/httpd/error_log',
:error_log_syslog => 'syslog:local0',
:log_level => 'reqtimeout:info',
@ -153,6 +154,7 @@ describe 'openstacklib::wsgi::apache' do
:access_log_file => '/var/log/httpd/access_log',
:access_log_syslog => 'syslog:local0',
:access_log_format => 'some format',
:access_log_env_var => 'dontlog=1',
:error_log_file => '/var/log/httpd/error_log',
:error_log_syslog => 'syslog:local0',
:log_level => 'reqtimeout:info',