📈Logging
Also known as Log, Logs, Log File, Application Log, Structured Logging
Writing down what a program does, one timed line per event.
Think of it like
It is like a ship's diary. Each line says what happened and when.
Example
A payment fails for one buyer. Jack searches the logs for the order number and finds the line saying the card was refused.
Why it matters
When something breaks, the log is often the only record of what took place.
Definition
Example code
json
{"time": "2026-11-16T09:14:02Z", "level": "error", "msg": "payment failed", "order": 4182}Common mistake
Key takeaways
- 1Time on every line. So events can be put in order.
- 2Structured. Named fields are easy to search.
- 3Gathered in one place. Logs from all servers, searched together.