The Caretaker's Ledger: On Building a Simple, Human-Readable Service Log
Most logging advice is a siren song of complexity. It beckons you towards sprawling platforms, intricate dashboards, and parsing languages that require a dedicated priesthood to interpret. We’re told to log everything, to structure our data, to feed the ever-hungry beast of our monitoring stack. But for the small service, the personal project, the tool that just needs to run quietly in the corner, this is overkill. It’s noise. I learned this the hard way, staring at a JSON blob that contained a thousand data points but no story.
I needed a different approach. I needed a ledger. Not a database, not an event stream, but a simple, chronological record written in plain language. The technique is straightforward: for every meaningful event in your service’s life, write a single, complete English sentence to a flat text file. Append it, stamp it with a timestamp, and leave it be.
Instead of {'event': 'backup_start', 'status': 'init', 'target': 's3://bucket/archive.tar.gz'}, you write: [2024-05-27 03:00:01] Starting nightly backup of user documents to the S3 deep archive bucket. An hour later, you append: [2024-05-27 04:02:15] Nightly backup completed successfully. Transferred 4.2 GiB across 18,551 files. And if it fails: [2024-05-27 03:15:44] ERROR: Backup halted. Failed to authenticate with object storage. Credentials may have expired.
The power of this method is its brutal clarity. There is no parsing. There is no query language. There is only reading. When you SSH into that machine at 3 AM, you don’t need to remember a complex syntax or log into a remote portal. You type tail -n 20 /var/log/my-service.log and you get a story, not a dataset. You see the narrative of what your service has been doing, in the order it happened, in a language you already speak.
This isn’t a replacement for metrics or alerting. It’s a companion to them. It provides the context that graphs cannot. A spike in memory usage on a dashboard is a symptom; the ledger entry that says ‘Initiated full-text index rebuild for user query’ is the diagnosis. It’s the caretaker’s journal, left open on the desk for the next person who comes on shift, telling them not just what happened, but why.
By choosing a human-readable format, you are building a log for humans. You are prioritizing the weary sysadmin over the efficient machine. In a world of overwhelming data, sometimes the most sophisticated tool is a simple, well-told story.
Notes & further reading
A few pages I came back to while writing this: