我正在运行Ubuntu 14.04,我想知道如何loggingHAProxy中发生的所有事情。 我一直在阅读关于日志和chroot的问题。 一切都告诉我在不同的文件中写不同的东西。
/var/log# ls alternatives.log apt bootstrap.log btmp dmesg dpkg.log faillog fsck lastlog upstart wtmp /etc/rsyslog.d# ls 49-haproxy.conf 50-default.conf
我的/etc/haproxy/haproxy.cfg文件包含这个:
global log 127.0.0.1 local0 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
我似乎无法看到任何地方的日志!
global log /var/lib/haproxy/dev/log local0 debug chroot /var/lib/haproxy frontend log /var/lib/haproxy/dev/log local4 debug
/dev/log不存在。 该套接字位于/var/lib/haproxy/dev/log 。
49-haproxy.conf文件:
local0.* -/var/log/haproxy/haproxy_0.log local4.* -/var/log/haproxy/haproxy_4.log if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log & ~
然后简单的杀死并开始:
/etc/init.d/rsyslog start /etc/init.d/haproxy start