Recently, HAProxy 1.9 was released to the public. One of the enhancements this release has had, is to the way it logs: HAProxy is now able to log to
stderr. Logging to
stderr is important for container environments, like Docker.
To enable logging to stdout, use the
log stdout local0
It works the same with
stderr. An alternative way to do that is to log to a file descriptor as shown:
log fd@1 local0
fd@1 parameter is an alias for
fd@2 is an alias for
stderr. This change also comes with two new log formats:
raw works well with Docker, and
short works well with systemd.
log stdout format raw local0
In my case, I have logging set up as follows:
global log stdout format raw local0 log stderr format raw local1
See the release blog post for more information.