Concept
Structured logs, one JSON object per line with a request id, let you search and correlate what happened. Metrics and health checks tell you how the service is doing before users do.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Logging and monitoring doing its job.
import Fastify from "fastify";
const app = Fastify({
logger: { level: process.env.LOG_LEVEL ?? "info", redact: ["req.headers.authorization"] },
genReqId: (req) => req.headers["x-request-id"] ?? crypto.randomUUID(),
});
app.get("/health", async () => ({ ok: true, uptime: process.uptime() }));
app.get("/orders/:id", async (req) => {
req.log.info({ orderId: req.params.id }, "loading order");
...
});Logging request bodies and headers wholesale. Passwords, tokens and personal data end up in the log system with a different retention and access policy. Redact and log what you need.
Your roadmap puts these before Logging and monitoring, unless you already know them.
Once a session shows you understand Logging and monitoring, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.