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

Safe HaskellNone
LanguageHaskell98

Network.Wai.Middleware.RequestLogger

Contents

Synopsis

Basic stdout logging

logStdout :: Middleware Source

Production request logger middleware.

logStdoutDev :: Middleware Source

Development request logger middleware.

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

Create more versions

data RequestLoggerSettings Source

RequestLoggerSettings is an instance of Default. See Data.Default for more information.

outputFormat, autoFlush, and destination are record fields for the record type RequestLoggerSettings, so they can be used to modify settings values using record syntax.

outputFormat :: RequestLoggerSettings -> OutputFormat Source

Default value: Detailed True.

autoFlush :: RequestLoggerSettings -> Bool Source

Only applies when using the Handle constructor for destination.

Default value: True.

type Callback = LogStr -> IO () Source

data IPAddrSource :: *

Source from which the IP source address of the client is obtained.

Constructors

FromSocket

From the peer address of the HTTP connection.

FromHeader

From X-Real-IP: or X-Forwarded-For: in the HTTP header.

FromFallback

From the peer address if header is not found.