World map

 

BM: Baca dalam Bahasa Melayu

World O4: The Diary & One Order

Structured logs

You will learn: to write diary lines that computers can filter and people can still read.

Checked with Prometheus 3 on 1 Nov 2026

The problem

Tap every line about order A1041.

0 of 3 found

The shop’s diary is messy. A customer asks: what happened to order A1041?

Watch

{"level":"error","msg":"payment timeout","order_id":"A1041","duration_ms":3000}

A structured log: A diary line with named fields, like JSON: level, msg, order_id. Computers can filter it; people can still read it. writes named fields. Which field finds every problem?

Pick one answer.

Try it

Build one diary line for a failed payment. Tap the pieces in order.

Tap the pieces in the right order.

…

Predict

The web team writes orderId. The pay team writes order_id. You search order_id = A1041. What happens?

Pick one answer.

Check

Swipe right if the field is fine to log. Swipe left if it should stay out.

Swipe right for good, left for needs work. Or use the buttons.

1 / 5order_id
order_id

Check

Least serious at the top. Put these in order. Use the arrows, or drag.

  • error
  • info
  • debug
  • warn

Sort the levels, from chatty to serious.

You did it!

You can now write structured log lines with clear fields and no secrets.

Go deeper (optional)

logfmt is another structured style: level=error msg="payment timeout" order_id=A1041. In containers, write logs to standard output. The platform collects them for you.

Real mission

  1. docker run --name diary-try alpine:3.22 echo '{"level":"info","msg":"shop open"}'
  2. docker logs diary-try
  3. docker rm diary-try

0 of 3 steps done · Your ticks are saved.