[cs631apue] sws testing

Jan Schaumann jschauma at stevens.edu
Mon Nov 21 11:28:13 EST 2016


mseaton <mseaton at stevens.edu> wrote:
> I am working on logging which is the -l option and I am very lost. Not 
> sure how to start. Any suggestions?

When you serve a request, append to the log file a line containing:

- The remote IP address.
- The time the request was received( in GMT).
- The (quoted) first line of the request.
- The status of the request.
- Size of the response in bytes.  Ie, "Content-Length".

For example, if a client connects from the address 1.2.3.4 and issues a
GET request for '/foo.htm', then you would append:

1.2.3.4 2016-11-21T16:24:23 "GET /foo.htm" 200 123456


-Jan


More information about the cs631apue mailing list