Commit ea0da24a authored by Łukasz Nowak's avatar Łukasz Nowak

rapid-cdn: Fix log for long requests

Long request lines result with truncated logs, which leads to impossibility to
debug cluster.

Maximize the log lines emitted by haproxy, and follow up this withing
accompanying rsyslogd.

Allow very long, but still much smaller, URI logging.
parent dddabd2c
......@@ -38,7 +38,7 @@ md5sum = cba4d995962f7fbeae3f61c9372c4181
[template-frontend-haproxy-configuration]
_update_hash_filename_ = templates/frontend-haproxy.cfg.in
md5sum = 545a0ff2f2dfaeb4342232398d8c8ebe
md5sum = e004cd9b0c739be5a21b2a5eb9ff6e40
[template-frontend-haproxy-crt-list]
_update_hash_filename_ = templates/frontend-haproxy-crt-list.in
......@@ -50,7 +50,7 @@ md5sum = d56e2cfab274cbbbe5b387f2f6e417df
[template-backend-haproxy-configuration]
_update_hash_filename_ = templates/backend-haproxy.cfg.in
md5sum = 629f4cc34dd7512eb61f10eac4e62d7a
md5sum = 13942d8f5525b748cf3cfc2665a87f63
[template-empty]
_update_hash_filename_ = templates/empty.in
......@@ -106,11 +106,11 @@ md5sum = 107dc147d94d02d2084b97b8ec591831
[template-frontend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/frontend-haproxy-rsyslogd.conf.in
md5sum = afbf1a74322f927a10306657b9a590ad
md5sum = 9f60941ba505bcb9eec5b09676411038
[template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
md5sum = ba91b7778c3d730353d42d7804ef8050
md5sum = 53bb2f095db7bc5cd3a238d3c1416502
[template-slave-introspection-httpd-nginx]
_update_hash_filename_ = templates/slave-introspection-httpd-nginx.conf.in
......
......@@ -6,7 +6,7 @@ module(
# haproxy emits enough information by itself
# Also cut out first empty space in msg, which is related to rsyslogd
# internal and end up cutting on 8k, as it's default of $MaxMessageSize
template(name="rawoutput" type="string" string="%msg:2:8192%\n")
template(name="rawoutput" type="string" string="%msg:2:65537%\n")
$ActionFileDefaultTemplate rawoutput
$FileCreateMode 0600
......
......@@ -2,8 +2,9 @@ global
pidfile {{ configuration['pid-file'] }}
# master-worker is compatible with foreground with process management
master-worker
tune.http.logurilen 16384
log {{ configuration['log-socket'] }} len 65535 local0
log {{ configuration['log-socket'] }} local0
defaults
log global
mode http
......
......@@ -6,7 +6,7 @@ module(
# haproxy emits enough information by itself
# Also cut out first empty space in msg, which is related to rsyslogd
# internal and end up cutting on 8k, as it's default of $MaxMessageSize
template(name="rawoutput" type="string" string="%msg:2:8192%\n")
template(name="rawoutput" type="string" string="%msg:2:65537%\n")
$ActionFileDefaultTemplate rawoutput
$FileCreateMode 0600
......
......@@ -8,7 +8,8 @@ global
# master-worker is compatible with foreground with process management
master-worker
expose-experimental-directives
log {{ configuration['log-socket'] }} local0
tune.http.logurilen 16384
log {{ configuration['log-socket'] }} len 65535 local0
defaults
mode http
......
......@@ -2365,7 +2365,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin, AtsMixin):
)
result = fakeHTTPSResult(
parameter_dict['domain'],
'test-path/deep/.././deeper',
'/test-path/deep/.././deeper' * 250,
headers={
'Timeout': '10', # more than default backend-connect-timeout == 5
'Accept-Encoding': 'gzip',
......@@ -2379,7 +2379,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin, AtsMixin):
headers = self.assertResponseHeaders(result)
self.assertNotIn('Strict-Transport-Security', headers)
self.assertEqualResultJson(result, 'Path', '?a=b&c=/test-path/deeper')
self.assertEqualResultJson(
result, 'Path', '?a=b&c=' + '/test-path/deeper' * 250)
try:
j = result.json()
......@@ -2399,7 +2400,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin, AtsMixin):
'_Url_access_log',
r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} - - '
r'\[\d{2}\/.{3}\/\d{4}\:\d{2}\:\d{2}\:\d{2} \+\d{4}\] '
r'"GET \/test-path\/deep\/..\/.\/deeper '
r'"GET \/(\/test-path\/deep\/..\/.\/deeper){250} '
r'HTTP\/%(http_version)s" \d{3} '
r'\d+ "-" "TEST USER AGENT" \d+' % dict(
http_version=self.max_client_version)
......@@ -2423,7 +2424,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin, AtsMixin):
r'\d+/\d+\/\d+\/\d+\/\d+ '
r'200 \d+ - - ---- '
r'\d+\/\d+\/\d+\/\d+\/\d+ \d+\/\d+ '
r'"GET /test-path/deeper HTTP/1.1"'
r'"GET (/test-path/deeper){250} HTTP/1.1"'
)
result_http = fakeHTTPResult(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment