I'm running almost the same config here (FreeBSD 7.2 instead of 7.0), and it's 
working fine here:


--from /etc/rc.conf:
apache22_enable="YES"
syslogd_flags="-a 127.0.0.1:*"

--from /etc/syslog.conf
local0.* /var/log/haproxy.log


$ ps auxw | grep syslog
root     1505  0.0  0.0  5692  1204  ??  Ss   Fri05PM   0:01.72 
/usr/sbin/syslogd -a 127.0.0.1:*

in my haproxy.conf is:
global
  log 127.0.0.1   local0 notice

-- 


With kind regards,


Angelo Höngens

Systems Administrator

------------------------------------------
NetMatch
tourism internet software solutions

Ringbaan Oost 2b
5013 CA Tilburg
T: +31 (0)13 5811088
F: +31 (0)13 5821239

mailto:[email protected]
http://www.netmatch.nl
------------------------------------------

From: William Angus [mailto:[email protected]] 
Sent: maandag 20 juli 2009 9:21
To: [email protected]
Subject: HAProxy not writing to logs.

Good afternoon,

I am unable to configure HAProxy to write to local logs on the server the 
process is running on..
I am currently configuring two load-balancers in failover using Common Address 
Redundancy Protocol (CARP) to service a pair of application servers through 
ports 8080 and 8443. Aside from writing to log files the system appears to be 
running well with both http and https traffic passing through to the backend 
servers.
Both proxy servers are configured identically with the following 
details/settings. The intention is to have a utility parse the logs and send 
status and/or warning emails as needed.

Server OS
FreeBSD 7.0-release amd64 with CARP compiled into the kernel.
--CARP is used for availability. The interface monitors the ip that is used to 
connect to the app servers.

HAProxy version
1.3.18 from ports/net/haproxy-devel/

--From /etc/syslog.conf
+127.0.0.1
local0.*                                        /var/log/haproxy.log
--I have tried this with +127.0.0.1, +localhost, both and neither. 
/var/log/haproxy.log is owned by haproxy user (tested when running process as 
root but still didn't write to the log when owned by root or haproxy user, root 
wouldn't be used live of course)

--From /etc/rc.conf
syslogd_enable="YES"
syslogd_flags="-a 127.0.0.1/24:* -4 -b 127.0.0.1"
haproxy_enable="YES"
--Have tried the -a and -b entries seperately and -b localhost. Also with and 
without -4 (I doubt this is strictly necessary as ip6 isn't currently 
configured on any interfaces so there would be no conflict).

 ps -auxw | grep syslog
root       627  0.0  0.1  4684  1380  ??  Ss    1:24PM   0:00.02 
/usr/sbin/syslogd -a 127.0.0.1/24:* -4 -b 127.0.0.1
--So the syslogd is running with the appropriate syslogd_flags (-b could also 
be used as localhost?) PID is different on second server but that is to be 
expected.

--/usr/local/etc/haproxy.conf - only changes from running are any ips, 
server-names or user/pass. This is a simpler one than I will be using in 
production. Intention is that the process will be jailed for security and other 
bits will be tweaked as needed. This is just a start-testing config.
global
    maxconn 4096
    pidfile /var/run/haproxy.pid
    daemon
    user haproxy
    group haproxy
    log 127.0.0.1 local0 info

defaults
    mode http
    retries 3
    option redispatch
    stats enable
    stats auth user:password
    maxconn 2000
    contimeout 5000
    clitimeout 50000
    srvtimeout 50000

listen name IP:8080 - this is the ip used by CARP interface
    log global
    mode http
    option httplog
    cookie name insert
    balance roundrobin
    option httpclose
    option forwardfor
    server server1 IP:8080 cookie name check
    server server2 IP:8080 cookie name check

listen name-secure IP:8443 - this is the ip used by CARP interface
    log global
    option tcplog
    mode tcp
    balance roundrobin
    option httpclose
    option forwardfor
    server server1 IP:8443 check
    server server2 IP:8443 check

The ip-address that the CARP interfaces monitor has an appropriate DNS record.
I am aware that the FreeBSD version of syslog doesn't support the -r tag that 
some Linux versions do and was wondering, if I can't get the process 
communicating over a socket is there an equivalent that I could use. 

Any ideas as to what I am missing?

Kind regards
William Angus

-- 
________________________________________

Consulting . Enterprise Architecture . Custom Software
Will Angus - Systems Analyst
Virtual Xpert Pty. Ltd.
Suite 207, 35 Buckingham St.
Surry Hills, NSW  2010
Australia
Ph: 
+61 2 9007 1480
Fax: 
+61 2 8905 9438
Mob: 
+61 424 298 449
Email: 
[email protected]
WWW: 
www.virtualxpert.com.au
ABN: 
21 118 797 354

________________________________________


Reply via email to