Chapter 14: Logging and Light Observability
14.5 Log groups, streams and agents (conceptual)
| Idea | Meaning |
|---|---|
| Log group | Folder-like container (e.g. /badge-api/lab/api) |
| Log stream | Sequence from one source (instance/container) |
| Agent / sidecar | Process that ships local logs to CloudWatch |
| Retention | How long AWS keeps events (set deliberately) |
High-level lab shape:
- Create a log group for badge API lab (name clearly
lab/learning). - Run a small app that writes ERROR lines to stdout or a file.
- Use an AWS-supported shipping method for your setup (CloudWatch agent, awslogs patterns, or container logging drivers — follow current AWS docs for your OS/engine).
- Open the console (or CLI) and confirm events appear.
- Query the last ERROR.
# CLI sketches — resource names are examples; adapt to your account
aws logs describe-log-groups --log-group-name-prefix /badge-api
# Filter / Insights commands differ by need — use AWS CLI help / docs for current syntax
What you see: timestamped events in a stream. If empty, verify IAM permissions, agent status, region mismatch, and that the app actually wrote after the agent started.
Ravindra Bagale's Tip
Region mismatch — agent ap-south-1, console us-east-1 — "logs missing" drama. Ek region lakshat theva. Dhyan rakho!