Estou tentando configurar meu HAProxy para registrar mais informações do que apenas dizer "proxy backend_xx iniciado" e parece que não estou entendendo como isso funciona.
meu HAProxy é um LB TCP puro (apenas encaminha solicitações do frontend para backends, L4 puro).
eu gostaria de ter os logs mencionados na documentação do HAProxy aqui https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#8.2.2
aqui está minha configuração e problemas no momento, nas "seções globais/padrão", eu tenho:
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
daemon
user haproxy
group haproxy
log /dev/log local6 debug
maxconn 50000
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode tcp
option tcplog
log global
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
eu também tenho essa opção no meu frontend:
frontend main_https_listen
bind xxxxxxxxxxxxxx:443
mode tcp
option tcplog
xxxxxxx
eu configurei um arquivo no meu rsyslog.d com:
[root@xxxxxxx ~]# cat /etc/rsyslog.d/haproxy.conf
# -----------------------------------------------
# Haproxy specific logging configuration
# -----------------------------------------------
local6.debug /var/log/haproxy-traffic.log
local6.notice /var/log/haproxy-admin.log
[root@xxxxxxx ~]#
infelizmente, ambos os arquivos contêm as mesmas informações, por exemplo:
[root@xxxxxxx ~]# tail -11 /var/log/haproxy-admin.log
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy stats started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy main_https_listen started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT35073 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT34305 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT28548 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT28756 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT36702 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_UAT_AT28546 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_PRD_AT28547 started.
[root@xxxxxxx ~]# tail -11 /var/log/haproxy-traffic.log
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy stats started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy main_https_listen started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT35073 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT34305 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT28548 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT28756 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_SIT_AT36702 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_UAT_AT28546 started.
Feb 25 18:05:30 xxxxxxx haproxy[838761]: Proxy backend_PRD_AT28547 started.
enquanto eu esperaria que o log de tráfego gerasse coisas como na documentação, por exemplo:
Feb 6 12:12:56 localhost \
haproxy[14387]: 10.0.1.2:33313 [06/Feb/2009:12:12:51.443] fnt \
bck/srv1 0/0/5007 212 -- 0/0/0/0/3 0/0
alguma idéia sobre o que está errado na minha configuração?
obrigado novamente
Saudações
encontrei o problema. eu tive que adicionar um "log global" no bloco "frontend" para dizer ao frontend para logar lá:
tão simples como isso. eu posso ver os logs agora, por exemplo: