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.
Hint
Start with the level. Leave out anything secret.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.
order_idCheck
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
docker run --name diary-try alpine:3.22 echo '{"level":"info","msg":"shop open"}'docker logs diary-trydocker rm diary-try
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Diari kedai bersepah. Pelanggan tanya: apa jadi pada pesanan A1041?
{"level":"error","msg":"payment timeout","order_id":"A1041","duration_ms":3000}Log berstruktur tulis medan bernama. Medan mana yang jumpa setiap masalah?
Bina satu baris diari untuk bayaran yang gagal. Ketik kepingan mengikut urutan.
Pasukan web tulis orderId. Pasukan bayaran tulis order_id. Anda cari order_id = A1041. Apa jadi?
Leret ke kanan jika medan itu boleh dilog. Leret ke kiri jika patut dikeluarkan.
Susun level, dari yang banyak cakap hingga yang serius.
Kini anda boleh tulis baris log berstruktur dengan medan jelas dan tanpa rahsia.
You finished this before. Practice is always welcome!
Official docs: OpenTelemetry: logs · Loki: log queries (json, logfmt)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?