diff --git a/README.md b/README.md index 731d28eb..cbd57ebf 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `haproxy_listen.{n}.balance`: [required]: The load balancing algorithm to be used (e.g. `roundrobin`) * `haproxy_listen.{n}.hash_type`: [optional]: The hashing type to be used for balancing (e.g. `consistent`) * `haproxy_listen.{n}.maxconn`: [optional]: Fix the maximum number of concurrent connections +* `haproxy_listen.{n}.logformat`: [optional]: Specifies the log format string to use for traffic logs (e.g. `'"%{+Q}o\ %t\ %s\ %{-Q}r"'`) * `haproxy_listen.{n}.source`: [optional]: Set the source address or interface for connections from the proxy * `haproxy_listen.{n}.option`: [optional]: Options to set (e.g. `[dontlog-normal]`) * `haproxy_listen.{n}.no_option`: [optional]: Options to set (e.g. `[dontlog-normal]`) diff --git a/templates/etc/haproxy/listen.cfg.j2 b/templates/etc/haproxy/listen.cfg.j2 index 26c30da2..dbda2a9d 100644 --- a/templates/etc/haproxy/listen.cfg.j2 +++ b/templates/etc/haproxy/listen.cfg.j2 @@ -40,6 +40,9 @@ listen {{ listen.name }} {% for option in listen.no_option | default([]) %} no option {{ option }} {% endfor %} +{% if listen.logformat is defined %} + log-format {{ listen.logformat }} +{% endif %} {% if listen.no_log | default(false) == true %} no log {% endif %}