Django settings日志配置

Python programmers will often use print() in their code as a quick and convenient debugging tool. Using the logging framework is only a little more effort than that, but it's much more elegant and flexible. As well as being useful for debugging, logging can also provide you with more - and better structured - information about the state and health of your application.


Django uses and extends Python's builtin logging module to perform system logging. This module is discussed in detail in Python's own documentation; this section provides a quick overview.


一份 Python logging 配置有下面四个部分组成:

  • Loggers
  • Handlers
  • 过滤器(filters)
  • Formatters

djangoproject | Django logging日志
djangoproject | 如何配置和使用日志