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[29465]: 100.20.194.139: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[29465]: 100.20.194.139: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