last_updated: 2026-06-21

Logstalgia with Caddy#

Install Logstalgia, e.g.

sudo apt install logstalgia

Logstalgia needs Common Log Format (CLF) to function.

Caddy#

Caddy does structured logging instead of CLF, but there is a Transform Encoder Module for Caddy’s Logger that can render CLF, e.g.

# since Caddy 2.4.4
caddy add-package github.com/caddyserver/transform-encoder

Add the following to a server directive:

log {
	output file /var/log/caddy/combined.log
	format transform `{request>host} {request>remote_ip} - {user_id} [{ts}] "{request>method} {request>uri} {request>proto}" {status} {size} "{request>headers>Referer>[0]}" "{request>headers>User-Agent>[0]}"`
	{
		time_format "02/Jan/2006:15:04:05 -0700"
	}
}

Restart Caddy

caddy fmt --overwrite /etc/caddy/Caddyfile && sudo -Hnu caddy caddy validate --config /etc/caddy/Caddyfile && systemctl restart caddy
# Note: `caddy add-package` needs a restart. Afterwards `systemctl reload caddy` is sufficient.

Show live traffic in Logstalgia:

ssh root@sf tail -f /var/log/caddy/combined.log | logstalgia --sync

More elaborate:

cat <<EOF > ~/.config/logstalgia.conf
[display]
frameless=true
fullscreen=true
screen=2

[logstalgia]
full-hostnames=true
group=HTML,URI=html?$,30
paddle-mode=vhost
pitch-speed=1
sync=true
EOF

ssh root@sf tail -f /var/log/caddy/combined.log | logstalgia --load-config ~/.config/logstalgia.conf --detect-changes