Re: can't get haproxy to write any logs

From: Willy Tarreau <w#1wt.eu>
Date: Fri, 25 Jul 2008 23:22:11 +0200


Hi Matthew,

On Fri, Jul 25, 2008 at 05:16:48PM -0400, Matthew Bachmann wrote:
> haproxy is working great for me, but I can't get it to write any logs
> messages. I've censored some info by replacing it with <a_name> for
> privacy reasons. Any help would be greatly appreciated.
>
> My command line is:
>
> haproxy -dV -f <path_to_config>
>
> I'm executing haproxy as root. I've tried setting the user and group
> to both nobody and root to see if that mattered. My config file
> looks like:
>
> global
> # log lots of stuff to localhost's syslog
> # add the following to /etc/syslog.conf so it listens to the
> messages that are sent
> #
>
> log localhost local0 debug
> # run as an unprivileged user just in case
> # user nobody
> # group nobody
> user root
> group root
> chroot /var/chroot/haproxy
> # limit the total number of connections
> maxconn 10000
> ulimit-n 21000
>
> defaults
> # client timeout can be relatively short
> clitimeout 5000
> # set to 10 seconds longer than the longest prod qpx
> calendar query
> srvtimeout 210000
> # set to 5 seconds because tcp retransmit is 3 sec (I think?)
> contimeout 5000
> # retry failed connection attempts (possibly to different
> backing server)
> retries 3
>
> listen stats :8080
> mode http
> stats uri /
> # doesn't seem like we should need "balance" here, but it
> barfs if it's not there
> balance roundrobin
>
> listen dashboard :80
> mode tcp
> balance roundrobin
> server dash-00 <host>:10000 maxconn 1
> server dash-01 <host>:10001 maxconn 1
> ...
>
>
> Syslogd is running and listening for socket connections:
>
> root 17312 0.0 0.0 3684 632 ? Ss Jul15 0:02
> syslogd -m 0 -r
>
> /etc/syslog.conf contains:
>
> # I think this will just be all of the haproxy log messages -matt
> local0.* /var/log/haproxy.log
>
>
> My os is:
>
> Linux r42br17 2.6.22.9-61.asl.1.fc3 #1 SMP Tue Nov 6 09:47:40 EST
> 2007 x86_64 x86_64 x86_64 GNU/Linux
>
>
> I ran a tcpdump:
>
> tcpdump -A dst port 514
>
> and didn't see any messages from haproxy to that port. Again, it's
> working great, I'm just getting 0 log messages. Any help would be
> greatly appreciated.

add "log global" in your listen sections (or alternatively in the defaults section). In your setup, only the process logs are enabled but no instance logs.

Regards,
Willy Received on 2008/07/25 23:22

This archive was generated by hypermail 2.2.0 : 2008/07/25 23:30 CEST