[Twisted-Python] HTTP combined log format in twisted.web.http changed from 13.2.0 to 14.0.0

Free Ekanayaka free at 64studio.com
Mon Dec 1 04:55:45 MST 2014


On Tue, Nov 25, 2014 at 4:26 PM, Free Ekanayaka <free at 64studio.com> wrote:

> Hi,
>
> it was
>
>             line = '%s - - %s "%s" %d %s "%s" "%s"\n' % (
>
> in 13.2.0 (twisted/web/http.py line 1920), and it's
>
>         u'"%(ip)s" - - %(timestamp)s "%(method)s %(uri)s %(protocol)s" '
>
> so basically the client IP now gets wrapped within double quotes, e.g. a
> log line that was looking like:
>
> 1.2.3.4 - - [25/Oct/2004:12:31:59 +0000] "GET /dummy HTTP/1.0" 123 - "-"
> "-"
>
> it now looks like:
>
> "1.2.3.4" - - [25/Oct/2004:12:31:59 +0000] "GET /dummy HTTP/1.0" 123 - "-"
> "-"
>
> as one can see in the unit tests in test_web.py too.
>
> What's the reason for this change?
>
> It feels it can potentially break code that parses log files and it also
> seems to diverge from the format described on the Apache web site:
>
> http://httpd.apache.org/docs/1.3/logs.html
>

I've inspected a bit the diff that introduced this change and read the
comments
on the relevant ticket, but couldn't figure out the reason for the change,
so I
filed #7730 to keep track of the issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20141201/da458b9f/attachment.html>


More information about the Twisted-Python mailing list