Compare a good run and a bad run of your logs

When something worked yesterday and fails today, the answer is usually in the lines that only appear in the bad run. This guide shows how to find them with Log Compare, using a small example you can follow.

When this helps

Five steps

  1. Export the good run as plain text from your log tool. Use a run that worked, such as the previous release or yesterday's batch.
  2. Export the bad run from the same application, ideally the same kind of request or job.
  3. Drop both files into Log Compare. The comparison runs as soon as both are loaded.
  4. Read the New tab first. These are messages only the bad run has. Then Missing: messages the good run has that the bad run lacks, which often means a step never finished. Then Changed.
  5. Open a row to see one example from each run, and check the "When it happened" strip. If the errors cluster near the end, the failure started there.

A worked example

Take an order service. Both runs handle 240 orders, one after another. In the bad run, every fourth order hits a slow payment provider. Log Compare reports these rows, in the order it ranks them:

TabMessage (numbers replaced by #)Good runBad run
NewWARN payment provider slow, retry # for order #060
NewERROR payment provider timeout after # ms for order #, with its two stack-trace lines folded in030
ChangedINFO order # shipped240180
ChangedINFO order # paid in # ms240210

Reading the rows together tells the story:

Now you know where to look: the payment provider call, its timeout and the retry, not the shipping or the cache.

Tips for better results

Your files are read in your browser and never uploaded.

Questions

What is a good run and a bad run?

Two logs of the same application: one where things worked, such as yesterday's batch or the release before, and one where they failed. Comparing them shows the messages that only the bad run has, which is usually where the problem starts.

Which runs should I compare?

Pick two runs that are as alike as possible: the same kind of request, job or test, from the same service. Differences in what was asked make more noise than differences in how it ran.

How big can the logs be?

Each file can be large, up to a few hundred MB, and is read in your browser. Very large logs take longer to read, so you can narrow them to the time window that failed before you export.

Can I use logs from Kubernetes or Graylog?

Yes, as plain text. Export the lines from your log tool first, for example one file per pod or per service. Structured JSON exports are not read by this version.

Are my logs uploaded?

No. Your browser reads both files on your device. Nothing is sent or saved, and closing the tab clears them.