I configured my rsyslog with below settings and was able to generate
haproxy.log in my directory /opt/app/haproxy but it gets generated with
owner root and file permission rw------.Does anybody know or implemented as
to how to change the ownership and file permissions for the log directory.I
know its a more of rsyslog question than HAProxy but if any body having any
idea?

Step 1 : Edit the config file of rsyslog(rsyslog.conf)
uncomment the below lines in rsyslog.conf :
#$ModLoad imudp
#$UDPServerRun 514

Add following line:
$UDPServerAddress 127.0.0.1

2. Create a file /etc/rsyslog.d/haproxy.conf and insert the following



if ($programname == 'haproxy' and $syslogseverity-text == 'info') then
-/opt/app/haproxy/log/haproxy-info.log
& ~

3.Now restart the rsyslog service
service rsyslog restart


Thanks & Regards,

Kuldip Madnani



On Tue, Feb 4, 2014 at 4:44 PM, Willy Tarreau <w...@1wt.eu> wrote:

> Hi Ryan,
>
> On Tue, Feb 04, 2014 at 04:00:14PM -0600, Ryan O'Hara wrote:
> > On Tue, Feb 04, 2014 at 02:05:24PM -0600, Kuldip Madnani wrote:
> > > Hi,
> > >
> > > I want to redirect the logs generated by HAProxy into some specific
> file .I
> > > read that in the global section in log option i can put a file location
> > > instead of IP address.I tried using that setting but it dint work for
> me,
> > > also i enabled tcp logging in my listener but no luck.Could any body
> tell
> > > if i am missing something.Here is my configuration:
> > > global
> > > ........
> > > log         /opt/app/workload/haproxy/log/haproxy.log syslog info
> > > ........
> >
> > On my systems (which use rsyslog) I do this:
> >
> >     log /dev/log local0
> >
> > Then I create /etc/rsyslog.d/haproxy.conf, which contains:
> >
> >     local0.* /var/log/haproxy
> >
> > And everything gets logged there.
>
> Just a minor point here, when you're dealing with a proxy which is used
> in contexts of high load (thousands to tens of thousands of requests per
> second), the unix socket's log buffers are too small on many systems, and
> many log messages are dropped. Thus on these systems, logging over UDP is
> preferred (which requires to setup the syslog server to listen to UDP,
> and preferrably only on localhost).
>
> Best regards,
> Willy
>
>

Reply via email to