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?


"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

  • 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 8 '15 at 5:59

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.