From 0bc5cd628042bf0a44df60a93085a4f991a84dfb Mon Sep 17 00:00:00 2001 From: Flavio Curella Date: Fri, 6 Nov 2015 10:19:41 -0600 Subject: Fixed #25684 -- Made runserver use logging for request/response output. Thanks andreif for the contributing to the patch. --- docs/topics/logging.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'docs/topics') diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt index be8c278d97..407f12aaef 100644 --- a/docs/topics/logging.txt +++ b/docs/topics/logging.txt @@ -484,6 +484,24 @@ Messages to this logger have the following extra context: * ``request``: The request object that generated the logging message. +.. _django-server-logger: + +``django.server`` +~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.10 + +Log messages related to the handling of requests received by the server invoked +by the :djadmin:`runserver` command. HTTP 5XX responses are logged as ``ERROR`` +messages, 4XX responses are logged as ``WARNING`` messages, and everything else +is logged as ``INFO``. + +Messages to this logger have the following extra context: + +* ``status_code``: The HTTP response code associated with the request. + +* ``request``: The request object that generated the logging message. + .. _django-template-logger: ``django.template`` @@ -729,6 +747,11 @@ When :setting:`DEBUG` is ``False``: * The ``django`` logger send messages with ``ERROR`` or ``CRITICAL`` level to :class:`AdminEmailHandler`. +Independent of the value of :setting:`DEBUG`: + +* The :ref:`django-server-logger` logger sends all messages at the ``INFO`` + level or higher to the console. + .. versionchanged:: 1.9 Django's default logging configuration changed. See :ref:`the release notes -- cgit v1.3