jcmoraisjr / haproxy-ingress

HAProxy Ingress

Home Page:https://haproxy-ingress.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not able to see access logs in haproxy ingress controller

sujanbonga-devops opened this issue · comments

Hi

I am using haproxy ingress controller and image is "quay.io/jcmoraisjr/haproxy-ingress:v0.13.8" and i want to enable access logs of haproxy to be stdout , i have configured in global as below to send logs to stdout . But when i do logs on haproxy pod i am not able to see the access logs like 200, 400 requests

global
daemon
unix-bind mode 0600
stats socket /var/run/haproxy/admin.sock level admin expose-fd listeners mode 600
maxconn 2000
hard-stop-after 10m
log stdout len 1024 format raw local0

I dont want to use any sidecar like rsyslog or fluend or fluentbit , I want to use container itself .

Can you help on this please
Config Map :-

kind: ConfigMap
metadata:
name: haproxy-ingress
namespace: zaml-mh-truist-qa
data:
#config-global: |

log stdout format raw local0

balance-algorithm: leastconn
config-defaults: |

mode http

option httplog

capture http headers for logging

config-frontend: |
# option 1: the 'http-request capture' line would capture ALL http request headers for logging, but we probably don't need
# them all, plus it's hard to read. The values are logged in the %hr field.
# http-request capture req.hdrs len 4096
#
# option 2: the 'capture request' lines below capture only the headers we really care about. The values are logged in the %hr field.
capture request header Host len 60
capture request header X-Forwarded-For len 63
capture request header Referer len 60
capture request header User-agent len 40
capture request header X-Zest-Disable-Score-Archive len 5
http-log-format: '{"local_time":"%Tl","GMT":"%T","backend":{"name":"%b","concurrent_connections":%bc,"source_ip":"%bi","source_port":%bp,"queue":%bq},"bytes":{"read":%B,"uploaded":%U},"captured_headers":{"request":"%hr","response":"%hs"},"client":{"ip":"%ci","port":%cp},"frontend":{"name":"%f","concurrent_connections":%fc,"ip":"%fi","port":%fp,"name_transport":"%ft","log_counter":%lc},"hostname":"%H","http":{"method":"%HM","request_uri_without_query_string":"%HP","request_uri_query_string":"%HQ","request_uri":"%HU","version":"%HV","unique_ID":"%ID","status_code":%ST,"request":"%r"},"process_concurrent_connections":%ac,"request_counter":%rt,"server":{"name":"%s","concurrent_connections":%sc,"ip":"%si","port":%sp,"queue":%sq},"timers":{"tr":"%tr","Ta":%Ta,"Tc":%Tc,"Td":%Td,"Th":%Th,"Ti":%Ti,"Tq":%Tq,"TR":%TR,"Tr":%Tr,"Tt":%Tt,"Tw":%Tw}}'
ssl-redirect: "true"
syslog-endpoint: "stdout"
syslog-format: "raw"
#syslog-facility: daemo
timeout-client: 310s
timeout-client-fin: 310s
timeout-server: 310s
timeout-server-fin: 310s
timeout-keep-alive: 310s

You'll probably need to move to v0.14 and add --master-worker command-line option, and after that configure log to stdout. Note that controller and proxy logs will be sent together in the same output.

Please lets move this to the slack channel since this issue tracker is exclusively for bugs and feature requests.