【问题标题】:How to include python django's starting message in logging如何在日志记录中包含 python django 的启动消息
【发布时间】:2021-05-12 15:23:42
【问题描述】:

在测试中,我发现 Python Django 应用程序的启动消息可能包含重要警告等,请参见下面的截图示例。但是,日志文件没有包含这些消息。

我想知道是否有任何设置可以将其包含在日志记录中?任何提示将不胜感激。

屏幕输出示例:

(venv3.7) [user@vnl1916 APPLICATION]$ python manage.py runserver 0.0.0.0:8000
Performing system checks...

System check identified some issues:

WARNINGS:
eav.Value.value_bool: (fields.W903) NullBooleanField is deprecated. Support for it (except in historical migrations) will be removed in Django 4.0.
        HINT: Use BooleanField(null=True) instead.

System check identified 1 issue (0 silenced).

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, authtoken, ebackendapp, sites.
Run 'python manage.py migrate' to apply them.
February 08, 2021 - 12:31:55
Django version 3.1.4, using settings 'ebackendproject.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
^C(venv3.7) [user@vnl1916 APPLICATION]$

【问题讨论】:

标签: python django logging


【解决方案1】:

我相信这是不可能的,因为消息会发送到标准输出,并且有些消息会在日志记录初始化之前发生。

【讨论】:

    猜你喜欢
    • 2014-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-20
    • 2020-06-26
    • 2010-09-25
    • 2020-01-06
    • 2011-09-16
    相关资源
    最近更新 更多