HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulewai-extra-3.1.16Haskell2010

Network.Wai.Middleware.RequestLogger.JSON

  • 3 values

Same as formatAsJSON but with response headers included

This is useful for passing arbitrary data from your application out to the WAI layer for it to be logged, but you may need to be careful to subsequently redact any headers which may contain sensitive data.

valuerequestToJSON
  1. :: Request

    The WAI request

  2. -> [ByteString]

    Chunked request body

  3. -> Maybe NominalDiffTime

    Optional request duration

  4. -> Value
#

Get the JSON representation for a request

This representation is identical to that used in formatAsJSON for the request. It includes:

method
path
queryString
size

The size of the body, as defined in the request. This may differ from the size of the data passed in the second argument.

body

The body, concatenated directly from the chunks passed in

remoteHost
httpVersion
headers

If a Just duration is passed in, then additionally the JSON includes:

durationMs

The duration, formatted in milliseconds, to 2 decimal places

This representation is not an API, and may change at any time (within reason) without a major version bump.