{{{
[16/Apr/2018 13:32:35] "GET /some/local/url HTTP/1.1" 200 7927
[2018-04-16 13:32:35,745] - Broken pipe from ('127.0.0.1', 57570)
}}}
This is because logging from `WSGIRequestHandler` uses `server_time` as
calculated using `BaseHTTPServer.log_date_time_string`. On the other hand,
`WSGIServer` uses logging without providing a `server_time`. This gets
"fixed" in `ServerFormatter.format` using `self.formatTime(record,
self.datefmt)`, which uses a completely different format.
Currently we make this at least consistent by providing the `datefmt`
parameter when constructing the logger, but it would be better if they
were coded to be in sync (and configurable?).
(Looking into it further, it looks like we should be using `%(asctime)s`
instead of `%(server_time)s`, but would be good if that were the suggested
default. In https://docs.djangoproject.com/en/2.0/releases/1.10
/#runserver-output-goes-through-logging we see `%(server_time)s`.)
--
Ticket URL: <https://code.djangoproject.com/ticket/29329>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* component: Uncategorized => Core (Other)
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:1>
* type: Uncategorized => Cleanup/optimization
* component: Uncategorized => Core (Other)
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:1>
* owner: nobody => Srinivas Reddy Thatiparthy
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:2>
* owner: Srinivas Reddy Thatiparthy => Hasan Ramezani
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:3>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:4>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"7b31ba541f1dfb3a8e782b1319c25a24f9d86f8a" 7b31ba54]:
{{{
#!CommitTicketReference repository=""
revision="7b31ba541f1dfb3a8e782b1319c25a24f9d86f8a"
Fixed #29329 -- Made datetime logging from runserver more consistent.
Setting default_msec_format=None will make it the same, unfortunately
it's not supported by Python, see https://bugs.python.org/issue40300.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29329#comment:6>