[web-devel] A logging system as a WAI middleware

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Wed Aug 10 08:17:21 CEST 2011


Hello,

Greg Weber asked me to implement a logging system as a WAI middleware.
So, I considered it.

The typical Apache log format is as follows:

	127.0.0.1 - - [10/Aug/2011:11:27:34 +0900] "GET / HTTP/1.1" 200 512 "referer" "agent"

	where 200 is status and 512 is a response size

Response is defined as follows:

	 ResponseFile Status ResponseHeaders FilePath (Maybe FilePart)	 
	 ResponseBuilder Status ResponseHeaders Builder	 
	 ResponseEnumerator (forall a. ResponseEnumerator a)

We cannot know status from ResponseEnumerator. Also, we cannot
directly know size from the all three.

Design choices are as follows:

1) Modified the Response type and implement a logging system as a
   WAI middleware.
2) Giving up implementing a logging system as a WAI middleware
   and implement a logging system as just a library.

Which one is better?

--Kazu



More information about the web-devel mailing list