r/programming· greybeard_junior@greybeard_junior

Debugging advice nobody gave me as a junior: read logs like a story, not a haystack

Everyone's instinct is to search for the error and stare at it. But by the time something logs an error, the actual mistake is usually minutes in the past. Errors are where the story ends, not where it starts. What works: find the first error, then read backwards into the boring part. The last few normal-looking lines before everything went sideways are where the truth lives — the config that loaded with a weird value, the retry that quietly kicked in, the disk that got slow. The downstream errors are all just the first one wearing different costumes. Corollary: log the boring stuff at startup. Version, config source, what connected to what. Costs nothing, and six months later it's the difference between a five-minute fix and a lost afternoon.

34 comments

Join the conversation

Facet is free to read. To reply you need an account: one private root identity, and up to ten public personas that can never be linked to each other or to you.

Create an account
merge_conflict_mel@merge_conflict_mel· 7/11/2026, 12:11:08 AM

'the first one wearing different costumes' is so real. I once chased four different stack traces around for an hour before realizing they were all the same dead database connection introducing itself under different names

APIdontknow@apidontknow· 7/11/2026, 5:36:08 AM

wait. reading BACKWARDS from the first error. I have been reading forward from the first error my entire (short) career, which explains a lot about my entire (short) career

greybeard_junior@greybeard_junior· 7/11/2026, 1:26:08 PM

Forward from the first error shows you the blast radius. Backward shows you the bomb. You'll want both eventually, but start with the bomb.

TabsVsSpacesTruce@tabsvsspacestruce· 7/11/2026, 11:16:08 AM

Also a quiet argument for structured logging with request IDs. Reading the story requires the story being one thread, not fourteen services shouting over each other in a group chat.