Add Apache WSGI logging parameters for pipe/syslog
Add parameters for advanced logging configurations in Apache to
support piped logging and support for syslog (via mod_syslog
available in Apache >= 2.5.0)
Co-Authored-By: Andy Botting <andy@andybotting.com>
Change-Id: Ifa33b2e84284d8032c4e4f54acb26c30fc285cb5
Takashi Kajinami
1 year, 8 months ago
73 | 73 | # The log file name for the virtualhost. |
74 | 74 | # Optional. Defaults to undef. |
75 | 75 | # |
76 | # [*access_log_pipe*] | |
77 | # Specifies a pipe where Apache sends access logs for the virtualhost. | |
78 | # Optional. Defaults to undef. | |
79 | # | |
80 | # [*access_log_syslog*] | |
81 | # Sends the virtualhost access log messages to syslog. | |
82 | # Optional. Defaults to undef. | |
83 | # | |
76 | 84 | # [*access_log_format*] |
77 | 85 | # The log format for the virtualhost. |
78 | 86 | # Optional. Defaults to undef. |
79 | 87 | # |
80 | 88 | # [*error_log_file*] |
81 | 89 | # The error log file name for the virtualhost. |
90 | # Optional. Defaults to undef. | |
91 | # | |
92 | # [*error_log_pipe*] | |
93 | # Specifies a pipe where Apache sends error logs for the virtualhost. | |
94 | # Optional. Defaults to undef. | |
95 | # | |
96 | # [*error_log_syslog*] | |
97 | # Sends the virtualhost error log messages to syslog. | |
82 | 98 | # Optional. Defaults to undef. |
83 | 99 | # |
84 | 100 | # [*custom_wsgi_process_options*] |
130 | 146 | $threads = 1, |
131 | 147 | $priority = 10, |
132 | 148 | $access_log_file = undef, |
149 | $access_log_pipe = undef, | |
150 | $access_log_syslog = undef, | |
133 | 151 | $access_log_format = undef, |
134 | 152 | $error_log_file = undef, |
153 | $error_log_pipe = undef, | |
154 | $error_log_syslog = undef, | |
135 | 155 | $custom_wsgi_process_options = {}, |
136 | 156 | $headers = undef, |
137 | 157 | $request_headers = undef, |
170 | 190 | wsgi_script_source => $::gnocchi::params::gnocchi_wsgi_script_source, |
171 | 191 | headers => $headers, |
172 | 192 | request_headers => $request_headers, |
193 | custom_wsgi_process_options => $custom_wsgi_process_options, | |
173 | 194 | access_log_file => $access_log_file, |
195 | access_log_pipe => $access_log_pipe, | |
196 | access_log_syslog => $access_log_syslog, | |
174 | 197 | access_log_format => $access_log_format, |
175 | 198 | error_log_file => $error_log_file, |
176 | custom_wsgi_process_options => $custom_wsgi_process_options, | |
199 | error_log_pipe => $error_log_pipe, | |
200 | error_log_syslog => $error_log_syslog, | |
177 | 201 | } |
178 | 202 | } |
0 | --- | |
1 | features: | |
2 | - | | |
3 | Added parameters for advanced configuration of httpd access and error log | |
4 | destinations including piped logging and syslog (see `mod_syslog`). Note | |
5 | that mod_syslog requires Apache2 >= 2.5.0. |
23 | 23 | :request_headers => nil, |
24 | 24 | :custom_wsgi_process_options => {}, |
25 | 25 | :access_log_file => nil, |
26 | :access_log_pipe => nil, | |
27 | :access_log_syslog => nil, | |
26 | 28 | :access_log_format => nil, |
29 | :error_log_file => nil, | |
30 | :error_log_pipe => nil, | |
31 | :error_log_syslog => nil, | |
27 | 32 | )} |
28 | 33 | end |
29 | 34 | |
40 | 45 | :custom_wsgi_process_options => { |
41 | 46 | 'python_path' => '/my/python/path', |
42 | 47 | }, |
43 | :access_log_file => '/var/log/httpd/access_log', | |
44 | :access_log_format => 'some format', | |
45 | :error_log_file => '/var/log/httpd/error_log', | |
46 | 48 | :headers => ['set X-XSS-Protection "1; mode=block"'], |
47 | 49 | :request_headers => ['set Content-Type "application/json"'], |
48 | 50 | :vhost_custom_fragment => 'Timeout 99' |
72 | 74 | :custom_wsgi_process_options => { |
73 | 75 | 'python_path' => '/my/python/path', |
74 | 76 | }, |
75 | :access_log_file => '/var/log/httpd/access_log', | |
76 | :access_log_format => 'some format', | |
77 | :error_log_file => '/var/log/httpd/error_log' | |
77 | )} | |
78 | end | |
79 | ||
80 | context 'with custom access logging' do | |
81 | let :params do | |
82 | { | |
83 | :access_log_format => 'foo', | |
84 | :access_log_syslog => 'syslog:local0', | |
85 | :error_log_syslog => 'syslog:local1', | |
86 | } | |
87 | end | |
88 | ||
89 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( | |
90 | :access_log_format => params[:access_log_format], | |
91 | :access_log_syslog => params[:access_log_syslog], | |
92 | :error_log_syslog => params[:error_log_syslog], | |
93 | )} | |
94 | end | |
95 | ||
96 | context 'with access_log_file' do | |
97 | let :params do | |
98 | { | |
99 | :access_log_file => '/path/to/file', | |
100 | } | |
101 | end | |
102 | ||
103 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( | |
104 | :access_log_file => params[:access_log_file], | |
105 | )} | |
106 | end | |
107 | ||
108 | context 'with access_log_pipe' do | |
109 | let :params do | |
110 | { | |
111 | :access_log_pipe => 'pipe', | |
112 | } | |
113 | end | |
114 | ||
115 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( | |
116 | :access_log_pipe => params[:access_log_pipe], | |
117 | )} | |
118 | end | |
119 | ||
120 | context 'with error_log_file' do | |
121 | let :params do | |
122 | { | |
123 | :error_log_file => '/path/to/file', | |
124 | } | |
125 | end | |
126 | ||
127 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( | |
128 | :error_log_file => params[:error_log_file], | |
129 | )} | |
130 | end | |
131 | ||
132 | context 'with error_log_pipe' do | |
133 | let :params do | |
134 | { | |
135 | :error_log_pipe => 'pipe', | |
136 | } | |
137 | end | |
138 | ||
139 | it { should contain_openstacklib__wsgi__apache('gnocchi_wsgi').with( | |
140 | :error_log_pipe => params[:error_log_pipe], | |
78 | 141 | )} |
79 | 142 | end |
80 | 143 | end |