We make Checkcraft, a desktop tool that checks an API response and the matching log records in one run. This post is about a small free page we built on the side, and you don't need Checkcraft to use it.

The situation

The test sends POST /orders, gets 201, checks a couple of fields and goes green. Ten minutes later someone asks why the order never reached payments. The answer is usually sitting in the logs of the next service, under the same trace id, as a WARN or an ERROR nobody looked at.

Finding it by hand means opening Kibana or a log file, guessing the right time window, copying the id from one line and searching again. With a few thousand lines it is slow and easy to miss the one line that matters.

What the page does

Paste a log into https://checkcraft.ru/en/guides/log-search-online.html?utm_source=devto and it

  • finds the trace ids in it on its own and lists them,
  • shows every line of the request you pick, from every service,
  • puts the requests with errors at the top of the list,
  • reads plain text lines and JSON lines (ECS trace.id, level, message),
  • understands W3C traceparent, traceId, trace_id, trace.id and X-Request-ID.

Everything runs in your browser. The log is not sent anywhere, so it is fine for a quick look at a real incident. The limit is 5 MB per paste.

The same thing in a shell

If you prefer the terminal, this gets you most of the way

grep -h "4bf92f3577b34da6a3ce929d0e0e4736" *.log | sort | grep -E "ERROR|WARN" 

It works until the logs are a mix of text and JSON from several services, which is exactly when the page saves time.

Why we bother

A status code tells you the server answered. The log tells you what happened after that. We kept seeing tests that only checked the first part, so we wanted the second part to take seconds instead of a Kibana session.

If you want to practise spotting this kind of bug, there is also a free practice API where every response is 200 and ten bugs are hidden inside, one of them only visible in the log: https://checkcraft.ru/en/guides/bug-hunt.html?utm_source=devto

What do you use to follow one request across services when the test says everything is fine?