日志格式由于没有日志地址,所以前端'http-in'被忽略

我从couchdb项目使用以下haproxy.cfg :

global maxconn 512 spread-checks 5 defaults mode http log global monitor-uri /_haproxy_health_check option log-health-checks option httplog balance roundrobin option forwardfor option redispatch retries 4 option http-server-close timeout client 150000 timeout server 3600000 timeout connect 500 stats enable stats scope . stats uri /_stats frontend http-in # This requires HAProxy 1.5.x # bind *:$HAPROXY_PORT bind *:5984 default_backend couchdbs backend couchdbs server couchdb1 127.0.0.1:15984 check inter 5s server couchdb2 127.0.0.1:25984 check inter 5s server couchdb3 127.0.0.1:35984 check inter 5s 

但是,我在haproxy.log文件中看到以下内容:

 [WARNING] 244/190008 (3040) : config : log format ignored for frontend 'http-in' since it has no log address. 

这个警告实际上是什么意思?


我haproxy的版本是:

 # haproxy --version HA-Proxy version 1.5.8 2014/10/31 

这是因为configuration文件说使用“在[global]”(这是log global语句)中指定的log global ,但global部分不包含任何日志规范,这是令人不安的。

要解决这个问题,把log 127.0.0.1 local0 (或者你最喜欢的syslog服务器和设施),如下所述