What you will learn
- Structure logs as JSON
- Aggregate centrally
- Avoid logging secrets
New to this? Start here
The basics, in plain English
Logs are the text messages your software writes while it runs, like “user logged in” or “payment failed”. When you have many servers, you collect all their logs into one place so you can search them together. That collecting and combining is called aggregation.
- Log
- A line of text your program writes to record that something happened.
- Log level
- A label like info, warning, or error showing how serious a message is.
- Aggregation
- Gathering logs from many machines into one searchable place.
- Structured logging
- Writing logs in a tidy format like JSON so computers can search them easily.
- Retention
- How long you keep logs before deleting them to save space.
- Search
- Looking through collected logs to find the clue you need.
01
Structured logs
Emit structured (JSON) logs and ship them to a central store (Loki, ELK) so you can query across all services. Never log secrets.
Finished this topic?
Mark it done to earn 100 XP and keep your streak alive.