wai-extra-1.2.0.6: Provides some basic WAI handlers and middleware.

Safe HaskellSafe-Infered

Network.Wai.Middleware.RequestLogger

Contents

Synopsis

Documentation

logStdout :: MiddlewareSource

Production request logger middleware. Implemented on top of logCallback, but prints to stdout

logCallbackSource

Arguments

:: (ByteString -> IO ())

A function that logs the ByteString log message.

-> Middleware 

Prints a message using the given callback function for each request. Designed for fast production use at the expense of convenience. In particular, no POST parameter information is currently given

This is lower-level - use logStdout unless you need this greater control

logStdoutDev :: MiddlewareSource

Development request logger middleware. Implemented on top of logCallbackDev, but prints to stdout

Flushes stdout on each request, which would be inefficient in production use. Use logStdout in production.

logCallbackDevSource

Arguments

:: (ByteString -> IO ())

A function that logs the ByteString log message.

-> Middleware 

Prints a message using the given callback function for each request. This is not for serious production use- it is inefficient. It immediately consumes a POST body and fills it back in and is otherwise inefficient

Note that it logs the request immediately when it is received. This meanst that you can accurately see the interleaving of requests. And if the app crashes you have still logged the request. However, if you are simulating 10 simultaneous users you may find this confusing. The request and response are connected by color on Unix and also by the request path.

This is lower-level - use logStdoutDev unless you need greater control.

Example ouput:

 GET search
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

 Status: 200 OK. search

 GET static/css/normalize.css
 Accept: text/css,*/*;q=0.1
 GET [("LXwioiBG","")]

 Status: 304 Not Modified. static/css/normalize.css

Deprecated