[spec] Adapting the HTTP Common Logging Format for use by Gemini servers
John Cowan
cowan at ccil.org
Sun Dec 27 19:59:02 GMT 2020
The Common Logging Format as defined by Apache and other HTML servers
contains one line per client request divided into seven fields separated by
a single space. They are:
1) IP address, either IPv4 or IPv6
2) Hostname of the client, or "-" if not known.
3) Name of the user, or "-" if not known.
4) Date in square brackets, in the form [10/Oct/2000:13:55:36 -0700].
5) Request line in double quotes.
6) Status code of response.
7) Number of bytes in the response body, or 0 if none.
I think there are two reasonable approaches to adapting this format to
Gemini, the "as compatible as possible" or "ACAP" approach, and the
"literal" approach. In either approach, fields 1 and 7 are just as in
HTTP, and fields 2 and 3 are just "-".
On the ACAP approach, field 4 uses the date format above, field 5 contains
GET followed by the path segment of the URL followed by HTTP/1.1 (all space
separated), and field 6 contains the Gemini code converted to an equivalent
HTTP code (e.g. 20 becomes 200). I'll work out the full equivalence later
if people like this.
On the literal approach, field 4 is ISO 8601 (RFC 3336) format, field 5 is
the URL request line (no quotes needed), and field 6 is the Gemini status
code unconverted.
The advantage of the ACAP approach is that it allows existing HTTP log
analyzers to be used. The literal approach keeps all available information
but will need its own analysis tools. Of course, a server can support both
log formats as well as any other formats desired, so the question is which
format is Best Practice if only one is provided. It's possible to convert
literal format to ACAP format after the fact, but not vice versa.
John Cowan http://vrici.lojban.org/~cowan cowan at ccil.org
"Mr. Lane, if you ever wish anything that I can do, all you will have
to do will be to send me a telegram asking and it will be done."
"Mr. Hearst, if you ever get a telegram from me asking you to do
anything, you can put the telegram down as a forgery."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20201227/bb62fb83/attachment-0001.htm>
More information about the Gemini
mailing list