【问题标题】:Log response time in Django views在 Django 视图中记录响应时间
【发布时间】:2020-07-23 02:56:27
【问题描述】:

在我看来,我正在使用 logger.info(message) 记录到一个文件

消息是一个字符串,必须包含 HTTP 状态以及处理请求所用的时间。

我在 HttpResponse() 中找不到请求-响应时间。

让我吃惊的是 django.server 记录了时间。他们是怎么做到的?

【问题讨论】:

    标签: python django python-3.x django-views


    【解决方案1】:

    不跟踪所用时间。行尾的数字是响应的大小(以字节为单位)。

    What's the meaning of the default output of manage.py runserver?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-17
      • 1970-01-01
      • 1970-01-01
      • 2016-09-28
      相关资源
      最近更新 更多