The Stonemason's Guide String: On the Straight Line of the Single Logfile
We build our small services with care, laying each line of code like a stone in a wall. We obsess over architecture, backups, and failovers—the grand designs. But the most profound reliability often comes not from the complex, but from a simple, taut line we can follow without deviation. In the quiet hum of our machines, that line is the single, aggregated logfile.
It’s a technique so simple it feels almost naive: configure every process, every micro-service, every supporting script in your system to write its logs to standard output (stdout) and standard error (stderr). Then, let your process supervisor—be it systemd, Docker, a simple init script, or something else—handle the rest. Its job is to gather those streams and write them, unfiltered and in order, to one single file.
Why this deliberate constraint? Because when the midnight page arrives and the metrics are screaming, you have one truth, not twenty. You are not a detective cross-referencing timestamps across a dozen fragmented files, wondering if the database container’s clock skew put event A before or after event B in the API log. You have one timeline. You can trace a user’s request from the edge router through the auth service, into the application core, and back out again in a continuous, unbroken stream. The story is whole.
This is the stonemason’s guide string—a single, sharp line against which every event is measured. It eliminates the debate over where to log. It annihilates the complexity of log rotation configured seventeen different ways. Your entire operational procedure collapses into a beautiful simplicity: watch one file. `tail -f` becomes your most powerful observability tool. `grep` becomes your query language. The chaos of a distributed system is forced into a coherent, linear narrative.
This isn’t to say you won’t have other tools. You will ship this single file to a central system for long-term storage and analysis. But the primary, on-disk source remains singular and pure. It is the first draft of history for your service, written in one hand, in one language, with no translation errors. In our pursuit of robustness, we often build labyrinths of data. Sometimes, the most resilient path is the straightest, simplest line we can possibly draw.
Notes & further reading
A few pages I came back to while writing this: