Next: http-status, Previous: answer, Up: Top
The (www server-utils log) module provides procedure generators for
writing log information to an output port. Each generator is conventionally
named log-SOMETHING-proc.
Return a procedure that writes an HTTP response log entry to port. The procedure is called with args client, method, upath (strings or symbols) and status (either an atom or a list), and writes a one-line entry of the form:
CLIENT - - [YYYY-MM-DD:HH:MM:SS TZ] "METHOD UPATH" STATUS1 STATUS2...where the ‘YYYY..TZ’ are the year, month, day, hour, minute, second and timezone components, respectively, of the
localtimerepresentation of the current time; and ‘STATUSn’ are the space-separated elements of status.Optional second arg gmtime? non-
#fmeans usegmtimeinstead oflocaltime. Optional third arg stamp-format specifies a format string passed tostrftimeto use for the timestamp portion that appears between the square braces (default: "%Y-%m-%d:%H:%M:%S %Z").Optional fourth arg method-pair? non-
#fmeans that method is expected to be a pair(meth.vers), in which case the portion between the double quotes becomes "meth upath vers". This is to support excruciating conformity to Apache for the benefit of downstream programs that might fall over less than gracefully otherwise. Please enjoy the slack.The buffering mode for port is set to line-buffered.