[racket] web server log format

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Dec 12 13:30:59 EST 2011

Alright. I looked into this more.

The 200 and 512 from the log are not about the request, they are about the
response:

"200 (%>s)
This is the status code that the server sends back to the client. This
information is very valuable, because it reveals whether the request
resulted in a successful response (codes beginning in 2), a redirection
(codes beginning in 3), an error caused by the client (codes beginning in
4), or an error in the server (codes beginning in 5). The full list of
possible status codes can be found in the HTTP specification (RFC2616
section 10).

2326 (%b)
The last part indicates the size of the object returned to the client, not
including the response headers. If no content was returned to the client,
this value will be "-". To log "0" for no content, use %B instead."

http://httpd.apache.org/docs/current/logs.html

But the Racket Web server only has request logging by default, not response
logging, so it makes something up in these positions. I will update the
docs to mention this.

Jay

On Fri, Dec 9, 2011 at 8:29 PM, Jordan Schatz <jordan at noionlabs.com> wrote:

> > I'll fix it for the next release sometime tomorrow.
> Thanks Jay : )
>
> On Fri, Dec 09, 2011 at 06:42:04PM -0700, Jay McCarthy wrote:
> > Hah. I just looked at the code and it has always had 200 and 512
> hard-coded
> > in the logging function. Hah. I'll fix it for the next release sometime
> > tomorrow.
> >
> > Jay
> >
> > On Fri, Dec 9, 2011 at 5:07 PM, Jordan Schatz <jordan at noionlabs.com>
> wrote:
> >
> > > I have a web server with logging setup like so:
> > > (serve/servlet start
> > >               #:log-file "../logs/server"
> > >               #:log-format 'apache-default)
> > >
> > > Here are the headers from a client request
> > > HTTP/1.1 200 OK
> > > Date: Fri, 09 Dec 2011 21:23:16 GMT
> > > Last-Modified: Thu, 08 Dec 2011 05:04:56 GMT
> > > Server: Racket
> > > Content-Type: text/html
> > > Accept-Ranges: bytes
> > > Content-Length: 2629
> > >
> > > And here is what the log records:
> > > 69.51.119.190 - - [09/Dec/2011:16:23:16 -0500] "GET /index.html
> HTTP/1.1"
> > > 200 512
> > >
> > > The log's request size doesn't seem to match the content length of the
> > > request, 512 vrs 2629, also every request size in the log is 512. Am I
> > > missing something?
> > >
> > > Thanks,
> > > Jordan
> > > _________________________________________________
> > >  For list-related administrative tasks:
> > >  http://lists.racket-lang.org/listinfo/users
> > >
> >
> >
> >
> > --
> > Jay McCarthy <jay at cs.byu.edu>
> > Assistant Professor / Brigham Young University
> > http://faculty.cs.byu.edu/~jay
> >
> > "The glory of God is Intelligence" - D&C 93
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111212/d502206b/attachment.html>

Posted on the users mailing list.