7

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!

Karl Morrison
  • 1,621
  • 4
  • 29
  • 43
  • Do the files exist? If not then try 'mkdir /var/log/haproxy/; touch /var/log/haproxy/haproxy_0.log; touch /var/log/haproxy/haproxy_1.log; touch /var/log/haproxy/haproxy.log; chmod 777 -R /var/log/haproxy/' – Ashley Primo Dec 12 '15 at 01:40
  • I have the exact same issue, also with docker. Files do exist, i have one log file for notice and one for the rest. The notice level one works fine though – Tomáš Plešek Jan 25 '16 at 11:22

1 Answers1

3

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"