~/talk

Logging and Exception Handling for Django

Talkat DjangoCon US 2019 · 2019-09-22..09-27· [python, security]
github:rgs258
slides:none on file

Covers Python's logging API and Django specifics: how settings.py provides a logging dict that gets handed to logging.dictConfig, how to create rotating FileHandler entries and wire handlers to django and root loggers, how logger.exception adds stack traces and how to include extra fields with a custom Formatter (example: hostname), how Django sends mail_admins when DEBUG is false, how to enable django.db.backends DEBUG for SQL, integrate Rollbar, and set sys.excepthook to capture uncaught crashes.

AI-written summary · about

  1. 0:00Intro
  2. 1:43Objectives
  3. 4:28Success Criteria
  4. 5:00How Can Logs Help
  5. 7:37Out of the Box Django Logging
  6. 9:43Configuring Django Logging (cont.)
  7. 10:51Configuring File Handler
  8. 11:44Print Messages
  9. 14:34Logging Levels
  10. 15:49Four Basic Classes
  11. 17:19Logger Hierarchy by Example
  12. 20:05Filters Example
  13. 21:31Make Your Own Formatter
  14. 22:37Formatter Example
  15. 23:56Raising Exceptions
  16. 25:12Handling Exceptions (cont.)
  17. 28:12Invisible Exception Handlers
  18. 29:19Making Your Own Exceptions
  19. 30:51Re-Raising and Chaining Exceptions
  20. 31:52Third Party Packages
  21. 34:07Application Crash Not Reported
  22. 34:56The Exception Hook
  23. 37:00Additional Resources
~/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.