Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- withApiLogger :: Tracer IO ApiLog -> ApiLoggerSettings -> Middleware
- newApiLoggerSettings :: IO ApiLoggerSettings
- data ApiLoggerSettings
- obfuscateKeys :: ( Request -> [ Text ]) -> ApiLoggerSettings -> ApiLoggerSettings
- data HandlerLog
-
data
ApiLog
=
ApiLog
{
- requestId :: RequestId
- logMsg :: HandlerLog
- newtype RequestId = RequestId Integer
Middleware
withApiLogger :: Tracer IO ApiLog -> ApiLoggerSettings -> Middleware Source #
Installs a request & response logger on a Wai application.
The logger logs requests' and responses' bodies along with a few other useful piece of information.
Settings
newApiLoggerSettings :: IO ApiLoggerSettings Source #
Create a new opaque
ApiLoggerSettings
data ApiLoggerSettings Source #
API logger settings
obfuscateKeys :: ( Request -> [ Text ]) -> ApiLoggerSettings -> ApiLoggerSettings Source #
Define a set of top-level object keys that should be obfuscated for a given request in a JSON format.
data HandlerLog Source #
Tracer events related to the handling of a single request.
LogRequestStart | |
LogRequest Request | |
LogRequestBody [ Text ] ByteString |
Request content, with list of sensitive json keys. |
LogResponse NominalDiffTime Request ( Maybe Status ) | |
LogResponseBody ByteString | |
LogRequestFinish |
Instances
API handler trace events are associated with a unique request ID.
ApiLog | |
|
Instances
Show ApiLog Source # | |
Generic ApiLog Source # | |
ToJSON ApiLog Source # | |
FromJSON ApiLog Source # | |
ToText ApiLog Source # | |
HasPrivacyAnnotation ApiLog Source # | |
Defined in Network.Wai.Middleware.Logging getPrivacyAnnotation :: ApiLog -> PrivacyAnnotation |
|
HasSeverityAnnotation ApiLog Source # | |
Defined in Network.Wai.Middleware.Logging getSeverityAnnotation :: ApiLog -> Severity |
|
ToObject ApiLog Source # | |
Defined in Network.Wai.Middleware.Logging |
|
type Rep ApiLog Source # | |
Defined in Network.Wai.Middleware.Logging
type
Rep
ApiLog
=
D1
('
MetaData
"ApiLog" "Network.Wai.Middleware.Logging" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
False
) (
C1
('
MetaCons
"ApiLog" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"requestId") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
RequestId
)
:*:
S1
('
MetaSel
('
Just
"logMsg") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
HandlerLog
)))
|
Just a wrapper for readability
Instances
Eq RequestId Source # | |
Show RequestId Source # | |
Generic RequestId Source # | |
ToJSON RequestId Source # | |
type Rep RequestId Source # | |
Defined in Network.Wai.Middleware.Logging
type
Rep
RequestId
=
D1
('
MetaData
"RequestId" "Network.Wai.Middleware.Logging" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"RequestId" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Integer
)))
|