From d5e5473f9333985644e34ea036bcace3e40602ec Mon Sep 17 00:00:00 2001 From: Benedikt Trefzer Date: Tue, 7 Nov 2023 17:25:41 +0100 Subject: [PATCH] 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 --- manifests/wsgi/apache.pp | 5 +++++ spec/defines/openstacklib_wsgi_apache_spec.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 89a772d7..5a1a8804 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -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, diff --git a/spec/defines/openstacklib_wsgi_apache_spec.rb b/spec/defines/openstacklib_wsgi_apache_spec.rb index 4d6416f0..a14a1693 100644 --- a/spec/defines/openstacklib_wsgi_apache_spec.rb +++ b/spec/defines/openstacklib_wsgi_apache_spec.rb @@ -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',