📝 Monitoring & Troubleshooting · Monitoring & Troubleshooting
Logging
Record useful events and errors.
Logs tell the story of what happened.
Log order ID, correlation ID, outcome, and safe error details.
💡 Think of logs like a ship's diary: when something goes wrong at sea, you read back through the entries to see exactly what happened and when.
💡 Why it matters
When a system misbehaves, you usually cannot watch it live; logs are the record of what it did. Good logs let you reconstruct the sequence of events, connect related steps, and understand an error without guessing. Logging too little leaves you blind, while logging the wrong things buries the useful lines or leaks private data.
🛠️ How to achieve it
⚠️ Signs of trouble
- •When something breaks, the logs say nothing useful.
- •Passwords or personal data appear in plain text in the logs.
- •Every line is at the same level, so nothing stands out.
- •You cannot connect the log lines belonging to one request.
🎯 Quick check
Score: 0/3Three questions to test the idea.
1. What are logs mainly for?
Answer: Recording what happened so you can reconstruct events
Logs are the written record of a system's behaviour, used to understand events after the fact.
2. What should never go into logs?
Answer: Passwords, card numbers and personal data
Secrets and personal data must be kept out of logs; record only safe details.
3. What does a correlation ID let you do?
Answer: Trace all the log lines belonging to one request
A correlation ID ties together the scattered lines of a single request so you can follow its journey.
