Module 10 · Project 10 · Centralize Logs with Loki or ELK · Lesson 36 of 48

Build it: one place for every log

Set up Loki (or EFK) for the cluster, make the app log properly, build a logs dashboard and a log alert, then test yourself.

In this lesson · about 40 minutes

  • Build Project 10 in stages
  • Investigate an incident with logs and metrics together
  • Explain logging in interview language

Build it in stages

  1. Install: Loki plus Promtail (or Grafana Alloy) with Helm into the monitoring namespace, and add Loki as a Grafana data source next to Prometheus. Or, to learn the other popular stack, Elasticsearch, Fluent Bit and Kibana.
  2. Log properly: switch the app to JSON logs (pino for Node, structlog for Python) with level, service, request_id and duration. Generate the request id at the web tier and pass it on in an X-Request-Id header.
  3. Protect: add redaction for password, token and authorization fields, and a collector filter as backup.
  4. Retention: 14 days for app logs, with Loki's chunks in an S3 bucket that has a lifecycle rule.
  5. Dashboard: errors per minute by app, top error messages, and a panel that links from a spike on the Project 09 metrics dashboard to the matching logs.
  6. Alert: one log-based alert, routed through the Alertmanager you set up in Project 09.

Break it on purpose

  • Kill a Pod, then find its last log lines in Loki (they're gone from kubectl logs).
  • Log a fake password on purpose. Does your redaction catch it?
  • Run a load test and watch the log volume. Which lines would you drop or sample?

Guided dialogue

Mock interview: logging

0 of 3 answered

I

Three common questions.

I

Users say exports fail sometimes. How do you investigate?

Flashcards

Project 10 flashcards

0 of 6 known

Say the answer out loud, flip the card, then be honest: cards you miss come back at the end.

6 left in the deck

Practice exam

Project 10 practice test

Eight questions, 10 minutes.

  • 8 questions · 10 minutes
  • No feedback until you submit. Flag questions to come back to them.
  • Aim for 85% or better before you move on. The real exam's 750 out of 900 is roughly 80–83%.

Write the 'Logging' section and one incident story for your project.

Consider these questions and write down your thoughts. What you write stays on this device.

Written by Noviq Academy in its own words. The labs are simulations: no real servers are touched. When you build the projects yourself, use a practice virtual machine or a free-tier cloud account you control, watch your cloud spending, and never run cleanup or delete commands on a machine you care about. Tool names belong to their owners; versions and output are shown for learning and may differ slightly from yours. Read-aloud and the whiteboard voice use your device's built-in voices.