On Tue, Aug 17, 2010 at 10:27:04AM -0400, Turlapati, Sreenivasa wrote:
> Hi,
> 
> Thxs a lot. Could you kindly let us know how can we read and understand
> the incoming request.

Just do as you would with other rules, however if you want to match some
contents data (eg: protocol or HTTP request), you must first ensure that
you get a full request before applying the use_backend rule. For instance :

frontend xxx1
        # use backend yyy if destination port is 12345
        acl is_port1 dst_port 12345
        use_backend yyy if is_port1

frontend xxx2
        # use backend yyy if clients talks HTTP
        tcp-request inspect-delay 30s
        tcp-request content accept if HTTP
        ...
        use_backend yyy if HTTP

> I read we need to carry out the below changes to capture the HAProxy
> log.
> 
> edit the value of SYSLOGD in /etc/default/syslogd
> SYSLOGD="-r" 
> Then set up syslog facility local0 and direct it to file
> /var/log/haproxy.log or your desired location by editing
> /etc/syslog.conf:
> 
> # Save HA-Proxy logs
> local0.*
> /var/log/haproxy_0.log
> local1.*
> /var/log/haproxy_1.log

yes that's it.

> Is there any way we can able to get the Log without making the above
> changes as we don't have permission to modify the syslog.conf.

Then the best solution is to have your own syslogd on your own port.
That's something very common, and people generally use syslog-ng for
that because it's fast, light and very flexible. It adds the benefit
that people who manage the system keep their syslog.conf intact and
people who manage their applications have their own syslog.conf and
their own port.

If it's just for testing purposes, then use netcat ("nc"). You make
it listen for UDP traffic on the port you want, then configure haproxy
to log on localhost on that port. That's frequently used on testing
platforms.

Alternatively you can log over a unix socket, but if someone restarts
the syslogd (eg: logrotate), the connection will break and remain
broken. And the loss rate over the unix socket is generally high.

Regards,
Willy


Reply via email to