id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 27233,IndexError when using django.request,Ben Whale,nobody,"To replicate the following stacktrace: {{{ Traceback (most recent call last): File ""/usr/lib/python2.7/logging/__init__.py"", line 861, in emit msg = self.format(record) File ""/usr/lib/python2.7/logging/__init__.py"", line 734, in format return fmt.format(record) File ""/mwe/venv/local/lib/python2.7/site-packages/django/utils/log.py"", line 173, in format if args[1][0] == '2': IndexError: tuple index out of range }}} follow these steps: 1) create a project ""django-admin startproject "" 2) put the following into settings.py {{{ LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'custom': { '()': 'django.utils.log.ServerFormatter', 'format': '[%(server_time)s] %(message)s %(request)r', } }, 'handlers': { 'custom': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'custom', }, }, 'loggers': { 'django.request': { 'handlers': ['custom'], 'level': 'DEBUG', 'propagate': False, }, } } }}} 3) run the server ""python manage.py runserver"" 4) navigate to /foobar The traceback should be printed in the console. TBH I was sure what to expect as the documentation (https://docs.djangoproject.com/en/1.10/topics/logging/#django-request) doesn't make it clear if the django.request logger is used when using the runserver command, especially when django.server essentially replicates django.request when running using runserver. The error occurs (I think) as the format method expects args to be a tuple consisting of the url, the response status code, and a number (the amount of data transferred?) but instead receives a tuple containing only the url.",Bug,closed,Uncategorized,1.10,Normal,invalid,django.request runserver IndexError,,Unreviewed,0,0,0,0,0,0