I get the error:
[ALERT] 342/125339 (1) : sendmsg logger #1 failed: No such file or directory (errno=2)
/srv/dockervolume/haproxy/etc/rsyslog.d/49-haproxy.conf file:
$AddUnixListenSocket /var/lib/haproxy/dev/log
local0.* -/var/log/haproxy/haproxy_0.log
local1.* -/var/log/haproxy/haproxy_1.log
if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log
& ~
/srv/dockervolume/haproxy/etc/haproxy/haproxy.cfg file:
global
log /var/lib/haproxy/dev/log local0 debug
chroot /var/lib/haproxy
maxconn 2048
tune.ssl.default-dh-param 2048
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
defaults
log global
mode http
option httplog
option dontlognull
retries 3
timeout connect 5000
timeout client 10000
timeout server 10000
backend my_backend
log /var/lib/haproxy/dev/log local0 debug
rsyslog is running:
root@haproxy:/# ps aux | grep rsys
syslog 37 0.0 0.0 116572 1876 ? Sl+ 12:57 0:00 rsyslogd -n -c5
And haproxy is working well otherwise!
I expect your issue is with the path, as you are chroot in "/var/lib/haproxy" and your socket is "/var/lib/haproxy/dev/log" the log path should be just "/dev/log"