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 配置有下面四个部分组成：