Skip to content

Commit 3b37f73

Browse files
authored
Merge pull request #79 from kjkeane/kjkeane-patch-1
Add log-tag and log-send-hostname
2 parents fa77a39 + 2661a95 commit 3b37f73

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

haproxy/templates/haproxy.jinja

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ global
3030
{%- else %}
3131
log /dev/log local0
3232
log /dev/log local1 notice
33+
{%- endif %}
34+
{%- if salt['pillar.get']('haproxy:global:log-tag') %}
35+
log-tag {{ salt['pillar.get']('haproxy:global:log-tag', 'haproxy') }}
36+
{%- endif %}
37+
{%- if salt['pillar.get']('haproxy:global:log-send-hostname') %}
38+
log-send-hostname {{ salt['pillar.get']('haproxy:global:log-send-hostname') }}
3339
{%- endif %}
3440
user {{ salt['pillar.get']('haproxy:global:user', 'haproxy') }}
3541
group {{ salt['pillar.get']('haproxy:global:group', 'haproxy') }}

pillar.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ haproxy:
1717
log:
1818
- 127.0.0.1 local2
1919
- 127.0.0.1 local1 notice
20+
# Option log-tag parameter, sets the tag field in the syslog header
21+
log-tag: haproxy
22+
# Optional log-send-hostname parameter, sets the hostname field in the syslog header
23+
log-send-hostname: localhost
2024
stats:
2125
enable: True
2226
socketpath: /var/lib/haproxy/stats

0 commit comments

Comments
 (0)