Effortless Logging: A deep dive into the logging module
summary
Deep dive into Python’s logging module explains exactly what happens: logger creates a LogRecord with context, handlers emit to streams or files and can send HTTP or email, formatters turn records into strings, and filters accept or reject records. Coverage includes hierarchy and propagate semantics (parent handlers run, filters don’t), levels and exc_info/stack_info, configuration via basicConfig/dict/file (basicConfig only applies once), JSON and buffered handlers, QueueHandler for multiprocessing, and practical recipes that work.
AI-written summary · about
chapters (23)
- 0:00Intro
- 1:16Why logging matters
- 2:41Versatility & Configurability
- 3:42How logging works
- 5:47Formatter
- 6:57The hierarchy
- 8:38The actual flow
- 9:58How to use it
- 10:56Common misuses
- 13:06How to configure it
- 14:05dictConfig
- 14:36Demo!
- 16:20Logger.handle
- 16:38Logger.callHandlers
- 17:47Handler.handle
- 18:28Sample recipes
- 19:16Logging JSON
- 19:39Using filters to add context
- 20:24Buffering
- 20:55Non blocking handling of records
- 21:41Console output
- 22:10Lazy evaluation
- 27:06Questions
related talks
24mA Deep Look at Logging
44mLogging and Exception Handling for Django
31mDevelopers Have the Logs Their Imagination Allows
11mUsing and abusing Python's logging module for more readable logs
11mUsing and abusing Python's logging module for more readable logs
20mPython Logging: A meditation on silent failures
28mLogfire - Uncomplicated Observability
26mWhat every developer should know about logging
