HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

  • Packagewai-extra-3.1.18
  • Exports22
  • LanguageHaskell2010
  • LicenceMIT
  • SourceRequestLogger.hs

Basic stdout logging

Create more versions

Settings type

Settings for the request logger.

Sets what which format,

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

Instances1Default

Settings fields

More settings

Settings for the Detailed OutputFormat.

mModifyParams allows you to pass a function to hide confidential information (such as passwords) from the logs. If result is Nothing, then the parameter is hidden. For example: > myformat = Detailed True (Just hidePasswords) > where hidePasswords p@(k,v) = if k = "password" then (k, "***REDACTED***") else p

mFilterRequests allows you to filter which requests are logged, based on the request and response.

Instances1Default
datadata 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.

    This picks either X-Real-IP or X-Forwarded-For depending on which of these headers comes first in the ordered list of request headers.

    If the X-Forwarded-For header is picked, the value will be assumed to be a comma-separated list of IP addresses. The value will be parsed, and the left-most IP address will be used (which is mostly likely to be the actual client IP address).

  • FromHeaderCustom [HeaderName]

    From a custom HTTP header, useful in proxied environment.

    The header value will be assumed to be a comma-separated list of IP addresses. The value will be parsed, and the left-most IP address will be used (which is mostly likely to be the actual client IP address).

    Note that this still works as expected for a single IP address.

  • FromFallback

    Just like FromHeader, but falls back on the peer address if header is not found.

  • FromRequest (Request -> ByteString)

    This gives you the most flexibility to figure out the IP source address from the Request. The returned ByteString is used as the IP source address.