1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #25684 -- Made runserver use logging for request/response output.

Thanks andreif for the contributing to the patch.
This commit is contained in:
Flavio Curella
2015-11-06 10:19:41 -06:00
committed by Tim Graham
parent 3792e291e6
commit 0bc5cd6280
6 changed files with 180 additions and 48 deletions

View File

@@ -397,6 +397,36 @@ Dropped support for PostgreSQL 9.1
Upstream support for PostgreSQL 9.1 ends in September 2016. As a consequence,
Django 1.10 sets PostgreSQL 9.2 as the minimum version it officially supports.
``runserver`` output goes through logging
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Request and response handling of the ``runserver`` command is sent to the
:ref:`django-server-logger` logger instead of to ``sys.stderr``. If you
disable Django's logging configuration or override it with your own, you'll
need to add the appropriate logging configuration if you want to see that
output::
'formatters': {
'django.server': {
'()': 'django.utils.log.ServerFormatter',
'format': '[%(server_time)s] %(message)s',
}
},
'handlers': {
'django.server': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'django.server',
},
},
'loggers': {
'django.server': {
'handlers': ['django.server'],
'level': 'INFO',
'propagate': False,
}
}
Miscellaneous
~~~~~~~~~~~~~