allow to use access_log_env_var for apache wsgi

Change-Id: I57be28826d4dca00acad95c72ca5948653546ebe
This commit is contained in:
Benedikt Trefzer 2023-11-07 18:47:24 +01:00 committed by Tobias Urdin
parent c342b381e8
commit 7a02d6c29c
3 changed files with 33 additions and 18 deletions

@ -47,16 +47,16 @@
# Optional. Defaults to $facts['os_workers']
#
# [*priority*]
# (optional) The priority for the vhost.
# Defaults to 10
# The priority for the vhost.
# Optional. Defaults to 10
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to 1
# The number of threads for the vhost.
# Optional. Defaults to 1
#
# [*wsgi_process_display_name*]
# (optional) Name of the WSGI process display-name.
# Defaults to undef
# Name of the WSGI process display-name.
# Optional. Defaults to undef
#
# [*ssl_cert*]
# [*ssl_key*]
@ -84,6 +84,11 @@
# The log format for the virtualhost.
# Optional. Defaults to undef.
#
# [*access_log_env_var*]
# Specifies that only requests with particular
# environment variables be logged.
# Optional. Defaults to undef
#
# [*error_log_file*]
# The error log file name for the virtualhost.
# Optional. Defaults to undef.
@ -97,20 +102,20 @@
# Optional. Defaults to undef.
#
# [*custom_wsgi_process_options*]
# (optional) gives you the opportunity to add custom process options or to
# Gives you the opportunity to add custom process options or to
# overwrite the default options for the WSGI main process.
# eg. to use a virtual python environment for the WSGI process
# you could set it to:
# { python-path => '/my/python/virtualenv' }
# Defaults to {}
# Optional. Defaults to {}
#
# [*headers*]
# (optional) Headers for the vhost.
# Defaults to undef
# Headers for the vhost.
# Optional. Defaults to undef
#
# [*request_headers*]
# (optional) Modifies collected request headers in various ways.
# Defaults to undef
# Modifies collected request headers in various ways.
# Optional. Defaults to undef
#
# == Dependencies
#
@ -143,6 +148,7 @@ class neutron::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,
@ -187,6 +193,7 @@ class neutron::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,

@ -0,0 +1,5 @@
---
features:
- |
Add the ``access_log_env_var`` parameter to the ``neutron::wsgi::apache``
class to allow filtering logs (eg. suppress healthecks)

@ -26,6 +26,7 @@ describe 'neutron::wsgi::apache' do
:access_log_pipe => nil,
:access_log_syslog => nil,
:access_log_format => nil,
:access_log_env_var => nil,
:error_log_file => nil,
:error_log_pipe => nil,
:error_log_syslog => nil,
@ -76,16 +77,18 @@ describe 'neutron::wsgi::apache' do
context 'with custom access logging' do
let :params do
{
:access_log_format => 'foo',
:access_log_syslog => 'syslog:local0',
:error_log_syslog => 'syslog:local1',
:access_log_format => 'foo',
:access_log_syslog => 'syslog:local0',
:error_log_syslog => 'syslog:local1',
:access_log_env_var => '!dontlog',
}
end
it { should contain_openstacklib__wsgi__apache('neutron_wsgi').with(
:access_log_format => params[:access_log_format],
:access_log_syslog => params[:access_log_syslog],
:error_log_syslog => params[:error_log_syslog],
:access_log_format => params[:access_log_format],
:access_log_syslog => params[:access_log_syslog],
:error_log_syslog => params[:error_log_syslog],
:access_log_env_var => params[:access_log_env_var],
)}
end