Quindi, ho configurato Haproxy in modo che il log passasse attraverso rsyslog e, per ora, venisse scaricato in un unico file.
Sta registrando in modo definitivo, dato che ricevo quei messaggi di "avvio" all'avvio, ma nessuna richiesta di registrazione HTTP. Cosa c'è di sbagliato nella mia configurazione?
haproxy.cfg :
global
log /dev/log local0 debug
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend webfront
option forwardfor
stats enable
stats uri /haproxy?statis
stats realm Haproxy\ Auth
stats auth user:password
bind *:80
timeout client 86400000
acl is_discourse hdr_end(host) -i discourse.mydomain.com
use_backend discourse if is_discourse
use_backend webserver if !is_discourse
backend discourse
balance source
option forwardfor
option httpclose
server server1 127.0.0.1:3080 weight 1 maxconn 1024 check inter 10000
backend webserver
balance source
option forwardfor
option httpclose
server server2 127.0.0.1:4080 weight 1 maxconn 1024 check inter 10000
File di registro :
root@kayak:/var/log/haproxy# tail haproxy.log
Nov 26 21:25:25 kayak haproxy[21646]: Proxy webfront started.
Nov 26 21:25:25 kayak haproxy[21646]: Proxy webfront started.
Nov 26 21:25:25 kayak haproxy[21646]: Proxy discourse started.
Nov 26 21:25:25 kayak haproxy[21646]: Proxy webserver started.
Nov 26 21:28:10 kayak haproxy[21868]: Proxy webfront started.
Nov 26 21:28:10 kayak haproxy[21868]: Proxy discourse started.
Nov 26 21:28:10 kayak haproxy[21868]: Proxy webserver started.
Nov 26 21:30:31 kayak haproxy[22045]: Proxy webfront started.
Nov 26 21:30:31 kayak haproxy[22045]: Proxy discourse started.
Nov 26 21:30:31 kayak haproxy[22045]: Proxy webserver started.
Ho visitato alcune delle pagine del webserver tra questi riavvii e ho causato alcuni errori 404. Perché non viene visualizzato nulla?
Modifica: file conf rsyslog.
/etc/rsyslog.d/49-haproxy.conf:
local0.* -/var/log/haproxy_0.log
if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log
& ~