Zum Hauptinhalt springen

Gesundheitsprüfung und Logs

Health

@app.get("/health")
def health():
return {"status": "ok"}, 200

Monitoring kann regelmäßig anklopfen: Läuft die App?

Logs

import logging
logging.basicConfig(level=logging.INFO)
logging.info("App start")

Loggen:

  • Start/Stop
  • Login-Fehlschläge (ohne Passwort!)
  • unerwartete Exceptions

Rate mal!

Passwort ins Log?

Auflösung

Niemals.

Übungen

Level 1

Health-Route.

Level 2

info beim Start.

Level 3

3 erlaubte vs 3 verbotene Log-Inhalte.

Mini-Quiz

Mini-QuizWofuer ist /health?

Health sitzt! Als Nächstes: Migrationen und Backups.