This episode makes HAProxy visible: syslog-based logging with a readable format, the statistics page and stats socket for real-time status, and the basics of reading metrics like request rate, response time, and server health status.

A good load balancer must be transparent. You need to know what requests come in, which server they're forwarded to, how long it took, and whether the servers are still healthy. Episode 7 builds that observation window.
You'll enable informative HTTP logging, open the statistics page, and use the stats socket to pull data without a GUI. The metrics you learn here are the seeds of the SLOs covered in episode 21.
HAProxy writes logs through syslog. Enable logging in the global and defaults sections:
global
log /dev/log local0
log /dev/log local1 notice
defaults
mode http
option httplog
log global
option dontlognullThe log /dev/log local0 directive directs logs to the local syslog, and option httplog enables the information-rich HTTP log format. option dontlognull prevents logging empty connections that produce no request.
A single HTTP log line looks like this:
127.0.0.1:52314 [10/Aug/2026:08:15:30.001] web_front/2: web_back/web1 0/0/0/12/12 200 567 - - ---- 1/1/1/1/0 0/0The important information in it:
127.0.0.1:52314.web_back/web1.12 ms total.200.567 bytes.The easiest way to see HAProxy's condition is the statistics page:
listen stats
bind *:8404
mode http
stats enable
stats uri /stats
stats refresh 10s
stats auth admin:s3cret
frontend web_front
bind *:80
mode http
default_backend web_back
backend web_back
balance roundrobin
server web1 127.0.0.1:8080 check
server web2 127.0.0.1:8081 checkThe stats enable directive turns on the page, stats uri /stats sets its path, and stats auth admin:s3cret protects it with a login. Open http://localhost:8404/stats in a browser to see the frontend and backend tables in real time.
On that page, pay attention to these columns:
The stats socket gives command-line access to HAProxy's runtime, the foundation of the runtime API in episode 9:
global
stats socket /run/haproxy.sock mode 660 level admin
stats timeout 30sAfter reloading, the socket can be used with socat:
echo "show stat" | socat stdio /run/haproxy.sock
echo "show info" | socat stdio /run/haproxy.sockThe command echo "show stat" | socat stdio /run/haproxy.sock returns the statistics table in CSV format, and echo "show info" | socat stdio /run/haproxy.sock shows process information.
The show stat output is CSV with the first line being the column names. To view only server status, filter with awk or cut:
echo "show stat" | socat stdio /run/haproxy.sock \
| awk -F, '/web_back/{print $1, $2, $18}'That line prints the backend name, server name, and status column. Getting used to reading this CSV helps a lot with automation in episode 18.
The two numbers people stare at most:
Req counter between two samples.Both give you a quick sense of whether the system is healthy or under pressure.
Health checks produce a per-server status. Patterns to watch out for:
fall and rise interval and tolerance.echo "show servers state web_back" | socat stdio /run/haproxy.sockecho "show servers state web_back" | socat stdio /run/haproxy.sock shows server state in a programmable format.
Episode 7 makes HAProxy observable: informative logs, an intuitive statistics page, and a programmable socket. This is the observability foundation that episode 18 will deepen.
Key takeaways:
option httplog gives you information-rich HTTP logs.socat.In the next episode we'll cover SSL/TLS & security — TLS termination and re-encryption, HTTP/2 support, cipher suite tuning and HSTS, and proper certificate management.