I’ve successfully set up haproxy to log to the local syslog server, into file /var/log/messages.
However, I noticed that the logs do contain a hostname that is not identical with the one the machine actually has:
localhost.localdomain, see for example:
Sep 13 19:13:14 localhost.localdomain haproxy: 126.96.36.199:47216 http_https~ collab_server/collab01 401 1013 --VN "PROPFIND /dav.php/addressbooks/family/ HTTP/1.1"
Next, I’ve added the option
log-send-hostname ipfire to haproxy.cfg and now the following line pops up in /var/log/messages.
Sep 13 19:13:14 localhost.localdomain ipfire haproxy: 188.8.131.52:47216 http_https~ collab_server/collab01 401 1013 --VN "PROPFIND dav.php/addressbooks/family/ HTTP/1.1"
So the new options inserts the given hostname instead of replacing it.
Is this a bug or a feature?
Btw, just found the same issues reported here.
Edit: using the shell command on this machine and command
logger -t test "This is a test message" logs the correct host to the log:
Sep 16 16:48:09 ipfire test: This is a test message