Learning to like Caddy v2

I’ve been using caddy since the very first release. The caddyfile syntax is so much better than any other webserver, I fell in love and swapped all sites from (nginx|lighttpd|apache httpd) to caddy v1. Everything “just worked” and that’s all I need. It was serving a few hundred thousand requests per hour without issue.

Along comes v2 and forces me to do work. I end up rewriting the caddyfiles to v2 from scratch, because that was easier than migrating the v1 configs. The one thing I hated is the v2 logging output. My entire log analysis toolchain broke because of the v2 log changes. I stayed on v1 forever because of this change in v2.

My day job involves endless parsing/querying json–I think I was trying to avoid turning caddy into yet another day job task. Now, I literally pipe the v2 json log output into mongodb. I’ve written a bunch of scripts to analyze the data in mongodb. caddy v2’s json is pretty clean, so it’s pretty easy to ingest, parse, analyze, and then make pretty graphs.

Why not just use google analytics or some other metrics system? Because our sites run with zero external requests and nearly zero javascript. All analysis relies on the log file. I can ship a self-contained raspberry pi somewhere, with caddy/mongo/scripts and have a fully functional system without needing the internet.

In sum, thanks for v2!

3 Likes