filter-logger-0.5.0.0: Filterable request logging wai middleware. Change how data is logged and when.

Copyright(c) Joseph Canero 2017
LicenseMIT
Maintainerjmc41493@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Middleware.FilterLogger.Internal

Description

 

Synopsis

Documentation

data FilterOptions Source #

Options for controlling log filtering.

Constructors

FilterOptions 

Fields

  • detailed :: Bool

    Boolean value indicating whether to log output should be detailed or not. Details include the response size and request duration in ms. Default is True.

  • logOnEmptyBody :: Bool

    Boolean value indicating whether to log messages when there is no request body. Default is True.

class LogShowable a where Source #

Typeclass for types that can be converted into a strict ByteString and be shown in a log.

Minimal complete definition

logShow

Methods

logShow :: a -> ByteString Source #

Convert the type into a strict ByteString to be displayed in the logs.

logShowJSON :: ToJSON a => a -> ByteString Source #

Helper function that can be used when you want to make an instance of ToJSON an instance of LogShowable. This helps avoid having to use UndecidableInstances.

logFilterJSON :: FromJSON a => ByteString -> Maybe a Source #

Helper function that can be used when you want to make an instance of FromJSON an instance of LogFilterable. This helps avoid having to use UndecidableInstances.

class LogFilterable a where Source #

Typeclass for types that can be converted into from a strict ByteString and will be used as arguments to LogFilter

Minimal complete definition

prep

Methods

prep :: ByteString -> Maybe a Source #

Try to convert the type from a strict ByteString.

class (LogFilterable a, LogShowable a) => Loggable a Source #

Helper Typeclass for types that implement both LogFilterable and LogShowable

type LogFilter a = a -> Maybe a Source #

Type that represents a log filtering function. If the return type is Nothing, then no log message will be created. Otherwise, a log message will be created using the (potentially different) returned value.

mkDefaultFilterLogger :: Loggable a => LogFilter a -> Middleware Source #

Make a filtering request logger with the default FilterOptions.

mkFilterLogger :: Loggable a => FilterOptions -> LogFilter a -> Middleware Source #

Given a valid LogFilter and custom FilterOptions, construct a filtering request logger.