7

Currently, my HAProxy logs have information about the incoming requests: HTTP version, method, host, path, and headers.

I am trying to debug my HAProxy config, and need to know what the resulting outgoing requests are, particularly the host and path.

How do I log outgoing requests so that I can debug HAProxy?

Paul Draper
  • 317
  • 5
  • 24

2 Answers2

0

"Outgoing" is relative, I believe, to whether you are proxying or reverse-proxying. I'd give you a detailed answer, but I think it's easier to point you to the specific CustomLog format of the documentation. http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#8.2.4

Otheus
  • 439
  • 3
  • 12
  • I am reverse proxying; I didn't know HAProxy could proxy. I see the log documentation, but I only see `http_request` which is the incoming request, not the (possibly modified) HTTP request HAProxy makes out. – Paul Draper May 08 '15 at 05:59
0

You can set the log-format, in HA configs.

For example, I set in "default" section of haproxy.cfg as :-

log-format %ci:%cp-[%t]-%ft-%b/%s-[%Tw/%Tc/%Tt]-%B-%ts-%ac/%fc/%bc/%sc/%rc-%sq/%bq

It gives me host, response time, ip etc... You can get log variables here :- http://blog.haproxy.com/2012/10/29/haproxy-log-customization/ like %H is for hostname.