Logging to syslog - wrong hostname in /var/log/messages

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]: 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]: 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

Out of a sudden, without changing anything, I noticed that HAproxy now logs the correct hostname in /var/log/messages, e.g.

Sep 19 19:30:55 localhost haproxy[13742]: http_https~ collab_server/collab01 207 1821 --VN “PROPFI
ND /dav.php/calendars/family/holiday/ HTTP/1.1”

I do not know what has changed on the firewall, not even a restart was done, anyway the logs are now as expected.