Skip to content

Logging for applications: levels, context and privacy

For developers, DevOps engineers and senior support or MSP staff who write or configure application logging and use logs to investigate problems. You should already be comfortable reading code in at least one language and know what a web request is. You'll choose log levels using RFC 5424 and Python's standard levels, write events that say when, where, who and what with an interaction ID, keep passwords, tokens and unnecessary personal data out of logs, protect logs from injection and tampering, and use them to build an investigation timeline. It's based on the OWASP Logging and Logging Vocabulary cheat sheets, OWASP Top 10 A09, RFC 5424 and the Python logging HOWTO. The privacy lesson uses the UK GDPR data minimisation principle (UK ICO guidance) as its example; it is not legal advice and does not grant any professional qualification, and your organisation's privacy and retention policies decide what you may log and for how long. Ends with a supervisor-graded review of real logging code.

Level
Intermediate
Length
About 95 minutes
Contents
5 lessons · final exam
Status
Published · updated 10 Oct 2026

Skills you'll practise

  • Choose the log level for an event using RFC 5424 severities and Python's standard logging levels
  • Write log events that record when, where, who and what, with an interaction identifier, in a structured format
  • Identify data that must not be written to logs and choose how to remove, mask or hash it
  • Identify log injection and other attacks on logs, and choose controls that protect logs
  • Use application logs to reconstruct what happened in an investigation timeline

Course outline

  1. 1.Choose the log level for an eventLesson · 18 min
  2. 2.Write log events that record when, where, who and whatLesson · 20 min
  3. 3.Identify data that must not be written to logsLesson · 18 min
  4. 4.Identify log injection and other attacks on logs, and protect themLesson · 18 min
  5. 5.Use application logs to reconstruct what happenedLesson · 13 min
  6. 6.Logging for applications: levels, context and privacy: knowledge checkKnowledge check · 14 questions
  7. 7.Logging for applications: levels, context and privacy: practical exerciseKnowledge check · 1 question
  8. 8.Final exam10 questions · passing it completes the course, so people who already know the material can test out

Sources it draws on

The lessons and questions are written from these references, so learners can go back to the original.

See it with your own jobs and topics

Tell us about your team and we'll walk you through setup, from choosing jobs to your first skills check.