Update haproxy logging configuration

Use httplog for appropriate listeners in default amphora image, instead
of tcplog for everything.

Change-Id: I162862dace86556262d25cbe8ab10433139ffc89
This commit is contained in:
Stephen Balukoff 2016-10-14 00:19:03 -07:00
parent 3ef947ad3a
commit ae5a3a99fb
4 changed files with 13 additions and 6 deletions

View File

@ -14,7 +14,7 @@ defaults
frontend octavia-frontend-api
option tcplog
option httplog
bind 0.0.0.0:OCTAVIA_PORT
mode http
default_backend octavia-backend-api
@ -26,4 +26,4 @@ backend octavia-backend-api
# the devstack plugin will add entries here looking like:
# server octavia-main <IP-main>:<PORT> weight 1
# server octavia-second <IP-second>:<PORT> weight 1
#
#

View File

@ -112,7 +112,14 @@ bind {{ lb_vip_address }}:{{ listener.protocol_port }} {{
{% macro frontend_macro(constants, listener, lb_vip_address) %}
frontend {{ listener.id }}
{% if (listener.protocol.lower() ==
constants.PROTOCOL_TERMINATED_HTTPS.lower() or
listener.protocol.lower() ==
constants.PROTOCOL_HTTP.lower()) %}
option httplog
{% else %}
option tcplog
{% endif %}
{% if listener.connection_limit is defined %}
maxconn {{ listener.connection_limit }}
{% endif %}

View File

@ -31,7 +31,7 @@ class TestHaproxyCfg(base.TestCase):
def test_render_template_tls(self):
fe = ("frontend sample_listener_id_1\n"
" option tcplog\n"
" option httplog\n"
" maxconn 98\n"
" redirect scheme https if !{ ssl_fc }\n"
" bind 10.0.0.2:443 "
@ -69,7 +69,7 @@ class TestHaproxyCfg(base.TestCase):
def test_render_template_tls_no_sni(self):
fe = ("frontend sample_listener_id_1\n"
" option tcplog\n"
" option httplog\n"
" maxconn 98\n"
" redirect scheme https if !{ ssl_fc }\n"
" bind 10.0.0.2:443 "
@ -274,7 +274,7 @@ class TestHaproxyCfg(base.TestCase):
def test_render_template_l7policies(self):
fe = ("frontend sample_listener_id_1\n"
" option tcplog\n"
" option httplog\n"
" maxconn 98\n"
" bind 10.0.0.2:80\n"
" mode http\n"

View File

@ -635,7 +635,7 @@ def sample_l7rule_tuple(id,
def sample_base_expected_config(frontend=None, backend=None, peers=None):
if frontend is None:
frontend = ("frontend sample_listener_id_1\n"
" option tcplog\n"
" option httplog\n"
" maxconn 98\n"
" bind 10.0.0.2:80\n"
" mode http\n"