Add parameter for Apache LogLevel in error logfile
Add the 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 error_log_level value is not defined, which corresponds to the default Apache's LogLevel warn. Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com> Change-Id: I6d55e1e7cda191ab03b90de51fea5a063d57ca63
This commit is contained in:
		
				
					committed by
					
						
						Takashi Kajinami
					
				
			
			
				
	
			
			
			
						parent
						
							33fb90326f
						
					
				
				
					commit
					f780769122
				
			@@ -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'],
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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`.
 | 
			
		||||
@@ -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'],
 | 
			
		||||
      )}
 | 
			
		||||
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user