Skip to content

Commit

Permalink
Add log-format to listen
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Apr 22, 2021
1 parent 1e1a791 commit 537b9ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]`)
Expand Down
3 changes: 3 additions & 0 deletions templates/etc/haproxy/listen.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 537b9ca

Please sign in to comment.