~/talk

Python Logging: A meditation on silent failures

Talkat PyOhio 2016 · 2016-07-30..07-31· [observability, testing]
links:none on file
slides:none on file

Claims that logging is as essential as tests, backed by a real bug: a SequelAlchemy upgrade causes welcome emails to stop going out half the time despite a codebase with 100% test coverage. Shows concrete Python tools: the stdlib logging module, custom Formatter subclasses, and RotatingFileHandler vs TimedRotatingFileHandler (example: 20-byte max with 5 backups). Recommends structured JSON logs for ingestion by Logstash, Splunk, Papertrail or New Relic Insights, and notes logging to a database proved about 2× slower and caused performance issues.

AI-written summary · about

  1. 0:00PYTHON LOGGING
  2. 0:44WHY LOGGING?
  3. 2:20ERRORS VS. FAILURES
  4. 2:49SHOULDN'T I JUST TEST MY CODE?
  5. 3:28DEPENDENCY CHANGES: A HORROR STORY
  6. 4:37WHAT IS LOGGING?
  7. 5:37ANATOMY OF A PYTHON LOGGER
  8. 5:55LOGGING LEVELS
  9. 6:15DEBUG INFO
  10. 8:02WHERE SHOULD MY LOGS GO?
  11. 9:22WHAT SHOULD I LOG?
  12. 10:28ADVANCED FORMATTING - EXTERNAL LIBRARIES - SUBCLASSING logging. Formatter
  13. 13:37HOW MUCH IS TOO MUCH?
  14. 16:39I HAVE LOGS! NOW WHAT?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.