Straight to the logs

Checking the logs first isn’t a new concept to me, or to most developers and system administrators. It’s been the default for as long as I can remember - probably ten years for me at this point, probably more. It stopped being a conscious decision and just became the thing you do. I might be preaching to the choir, but it’s on my mind.

What do you mean by “straight to the logs”?

It doesn’t mean opening a log file, skimming for red text, and closing it again when you don’t immediately see something obvious. That’s not checking the logs - that’s performing due diligence.

It really should be deliberately slower. You read the logs in sequence, from before the problem happened. Not just the error, but what surrounded it. What came in, what went out, what happened in between. The log isn’t just an error report - it’s a timeline, and timelines tell you things error messages don’t. You find out what state the system was in before the failure. You find out what triggered the chain. You find out whether the error you’re looking at is the cause of the problem or the consequence of something else.

A lot of debugging time gets wasted chasing ghosts, in my experience. The error message points at one thing. The actual fault is three steps upstream, invisible from where you’re standing. If you take the error at face value and start working backwards from it, you can be wrong in a very coherent way for quite a long time.

The Nginx problem I was dealing with recently is a clean example. Google Chat sending webhook requests, 401s coming back, everything seemingly configured correctly. Clear symptom. Obviously pointed at an auth issue - credentials, config, permissions. Reasonable theories, all of them wrong. The logs told a different story: the Authorization header was arriving intact at the container boundary and being overwritten by the time it hit the application. The proxy configuration was doing exactly what it had been told to do, just not what this particular use case needed. You can’t see that from the 401 alone.

Where the habit gets tested

Even with a well-established habit, there are moments when the discipline slips.

One is speed. You’re in the middle of something, a deployment breaks, there’s a meeting in forty minutes, you’ve seen something similar before and your instincts are saying “it’s probably X”. The pull toward the theory is strong. The logs feel like overhead. And sometimes the instinct is right and you save yourself five minutes. But when it’s wrong - and it’s going to be wrong some of the time - the cost is usually much higher than the five minutes you saved.

Another is familiarity. On a system you know well, you develop a model of how things behave, and that model is useful. The problem is that the model doesn’t update itself. Infrastructure changes. Dependencies update. Something that behaved one way six months ago doesn’t necessarily behave that way now. The logs reflect what’s actually happening. The mental model reflects what used to happen. Trusting the model over the logs is how you end up debugging a ghost.

And the third is a kind of optimism that’s hard to argue against in the moment. You made a change, you think it fixed it, you want to confirm the fix rather than look for evidence the problem persists. So you look at the logs for confirmation rather than information. You find what you were hoping to find - or you don’t find the specific thing you were afraid of - and you call it done. That’s not reading logs. That’s asking a question you already know the answer to.

What the logs are actually for

The practical value is obvious - you find errors, you trace failures, you understand what the system did. But there’s a second value that doesn’t get as much limelight, which is what long-term log reading does to your intuition about a system.

If you read the logs regularly, not just when something breaks but as a general practice, you develop a sense of what normal looks like. You know what traffic patterns look like in the morning versus the evening. You know which containers are chatty and which are quiet. You know what a clean deployment looks like in the logs versus one that had a hiccup. That background knowledge is what makes your instincts actually trustworthy - because they’re grounded in real data rather than just time in the role.

People sometimes talk about experience as if it’s just a count of years. I think a lot of it is actually this: you’ve seen enough of what normal looks like that you recognise when something isn’t normal, before the alerts go off, before the obvious failure appears, before the symptom makes it undeniable. That recognition comes from having paid attention to the signal when nothing was wrong, not just when things were.

The logs are where the signal lives. That’s why they’re the first stop, and why they’ve been the first stop for a long time - not because someone told me to, but because that’s where the closest thing to a true account of what happened lives. The rest is a theory.