Structured logging
P37.logging.01 · Audience: Guest, IT/ML learner, Language professional
P37.logging.01 · Audience: Guest, IT/ML learner, Language professional
Observability starts with logs — but not the print-a-sentence kind. A production
service logs structured records: dicts of key/value fields a log system can
filter, aggregate and alert on. This module has you build a structured logger, so
the two mechanics that make it work — context binding and redaction — are
yours.
"handled request for alice, status 200" you emit {"event": "handled", "user": "alice", "status": 200} — now "all 500s for alice" is a query, not a grep.Why it matters — You cannot filter or alert on a sentence; a log system works on fields, so a structured record is what makes logs useful at scale.
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
Off by default. The mentor always gets your file; this only decides whether your own copy stays here. Copies live in this browser only - they do not follow you to another device, and clearing site data removes them.
Build a structured logger with context binding and PII redaction, then design a service's logging in an interview-style prompt.
Loading exercise…
Loading exercise…
Logs tell you about individual events. The next module adds the second and third pillars — metrics for aggregates and traces for where the time went.
Loading your notes...