diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index d04d0407..4cee1f92 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -232,6 +232,10 @@ # (Optional) Sends the virtualhost error log messages to syslog. # Defaults to undef # +# [*log_level*] +# (Optional) Specifies LogLevel for Apache WSGI. +# Defaults to undef +# define openstacklib::wsgi::apache ( $service_name = $name, $servername = $::fqdn, @@ -279,6 +283,7 @@ define openstacklib::wsgi::apache ( $error_log_file = undef, $error_log_pipe = undef, $error_log_syslog = undef, + $log_level = undef, ) { include apache @@ -389,6 +394,7 @@ define openstacklib::wsgi::apache ( error_log_file => $error_log_file, error_log_pipe => $error_log_pipe, error_log_syslog => $error_log_syslog, + log_level => $log_level, options => ['-Indexes', '+FollowSymLinks','+MultiViews'], } diff --git a/releasenotes/notes/openstacklib-wsgi-apache-log-level-f0f1567b27c64ac0.yaml b/releasenotes/notes/openstacklib-wsgi-apache-log-level-f0f1567b27c64ac0.yaml new file mode 100644 index 00000000..24af828e --- /dev/null +++ b/releasenotes/notes/openstacklib-wsgi-apache-log-level-f0f1567b27c64ac0.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Add `log_level` parameter to control `LogLevel` for Apache vhost. + By default, Apache only logs warnings and errors in its errors logfile, + while request timeouts are logged by `mod_reqtimeout` at LogLevel info. + Default `log_level` value is not defined, which corresponds to + the default Apache `LogLevel warn`. diff --git a/spec/defines/openstacklib_wsgi_apache_spec.rb b/spec/defines/openstacklib_wsgi_apache_spec.rb index 5b79a53e..4644cef8 100644 --- a/spec/defines/openstacklib_wsgi_apache_spec.rb +++ b/spec/defines/openstacklib_wsgi_apache_spec.rb @@ -100,6 +100,7 @@ describe 'openstacklib::wsgi::apache' do :error_log_file => nil, :error_log_pipe => nil, :error_log_syslog => nil, + :log_level => nil, :options => ['-Indexes', '+FollowSymLinks','+MultiViews'], )} @@ -114,11 +115,11 @@ describe 'openstacklib::wsgi::apache' do :wsgi_script_source => '/usr/share/keystone/keystone.wsgi', :wsgi_pass_authorization => 'On', :wsgi_chunked_request => 'On', - :custom_wsgi_script_aliases => { '/admin' => '/var/www/cgi-bin/keystone/admin' }, + :custom_wsgi_script_aliases => { '/admin' => '/var/www/cgi-bin/keystone/admin' }, :headers => 'set X-Frame-Options "DENY"', :request_headers => 'set Content-Type "application/json"', :aliases => [ - { 'alias' => '/robots.txt', 'path' => '/etc/keystone/robots.txt', }, + { 'alias' => '/robots.txt', 'path' => '/etc/keystone/robots.txt', }, ], :servername => 'dummy.host', :bind_host => '10.42.51.1', @@ -134,7 +135,8 @@ describe 'openstacklib::wsgi::apache' do :access_log_syslog => 'syslog:local0', :access_log_format => 'some format', :error_log_file => '/var/log/httpd/error_log', - :error_log_syslog => 'syslog:local0' + :error_log_syslog => 'syslog:local0', + :log_level => 'reqtimeout:info', } end @@ -172,7 +174,8 @@ describe 'openstacklib::wsgi::apache' do :access_log_syslog => 'syslog:local0', :access_log_format => 'some format', :error_log_file => '/var/log/httpd/error_log', - :error_log_syslog => 'syslog:local0' + :error_log_syslog => 'syslog:local0', + :log_level => 'reqtimeout:info', )} end