graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Server.Logging

Description

This is taken from wai-logger and customised for our use

Synopsis

Documentation

data PGLog Source #

Constructors

PGLog 

Instances

Instances details
ToJSON PGLog Source # 
Instance details

Defined in Hasura.Server.Logging

Eq PGLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

(==) :: PGLog -> PGLog -> Bool #

(/=) :: PGLog -> PGLog -> Bool #

ToEngineLog PGLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

data GQLQueryOperationSuccessLog Source #

GQLQueryOperationSuccessLog captures all the data required to construct an HTTP success log.

Instances

Instances details
ToJSON GQLQueryOperationSuccessLog Source # 
Instance details

Defined in Hasura.Server.Logging

Generic GQLQueryOperationSuccessLog Source # 
Instance details

Defined in Hasura.Server.Logging

Associated Types

type Rep GQLQueryOperationSuccessLog :: Type -> Type #

Eq GQLQueryOperationSuccessLog Source # 
Instance details

Defined in Hasura.Server.Logging

type Rep GQLQueryOperationSuccessLog Source # 
Instance details

Defined in Hasura.Server.Logging

type Rep GQLQueryOperationSuccessLog = D1 ('MetaData "GQLQueryOperationSuccessLog" "Hasura.Server.Logging" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "GQLQueryOperationSuccessLog" 'PrefixI 'True) ((S1 ('MetaSel ('Just "gqolQuery") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GQLReqUnparsed) :*: S1 ('MetaSel ('Just "gqolQueryExecutionTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DiffTime)) :*: (S1 ('MetaSel ('Just "gqolResponseSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int64) :*: (S1 ('MetaSel ('Just "gqolRequestSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int64) :*: S1 ('MetaSel ('Just "gqolParameterizedQueryHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ParameterizedQueryHash)))))

data GQLQueryOperationErrorLog Source #

GQLQueryOperationErrorLog captures the request along with the error message

data RequestMode Source #

whether a request is executed in batched mode or not

Constructors

RequestModeBatched

this request is batched

RequestModeSingle

this is a single request

RequestModeNonBatchable

this request is of a kind for which batching is not done or does not make sense

RequestModeError

the execution of this request failed

type HttpLogMetadata m = (CommonHttpLogMetadata, ExtraHttpLogMetadata m) Source #

The http-log metadata attached to HTTP requests running in the monad m, split into a common portion that is present regardless of m, and a monad-specific one defined in the HttpLog instance.

This allows us to not have to duplicate the code that generates the common part of the metadata across OSS and Pro, so that instances only have to implement the part of it unique to them.

emptyHttpLogMetadata :: forall m. HttpLog m => HttpLogMetadata m Source #

synonym for clarity, writing `emptyHttpLogMetadata m` instead of `def (HttpLogMetadata m)`

data LoggingSettings Source #

Setting used to control the information in logs

Constructors

LoggingSettings 

Fields

Instances

Instances details
Eq LoggingSettings Source # 
Instance details

Defined in Hasura.Server.Logging

class Monad m => HttpLog m where Source #

Associated Types

type ExtraHttpLogMetadata m Source #

Extra http-log metadata that we attach when operating in m.

Methods

emptyExtraHttpLogMetadata :: ExtraHttpLogMetadata m Source #

buildExtraHttpLogMetadata :: ParameterizedQueryHashList -> ExtraUserInfo -> ExtraHttpLogMetadata m Source #

logHttpError Source #

Arguments

:: Logger Hasura

the logger

-> LoggingSettings

setting used to control the information in logs

-> Maybe UserInfo

user info may or may not be present (error can happen during user resolution)

-> RequestId

request id of the request

-> Request

the Wai.Request object

-> (ByteString, Maybe Value)

the request body and parsed request

-> QErr

the error

-> [Header]

list of request headers

-> HttpLogMetadata m 
-> m () 

logHttpSuccess Source #

Arguments

:: Logger Hasura

the logger

-> LoggingSettings

setting used to control the information in logs

-> Maybe UserInfo

user info may or may not be present (error can happen during user resolution)

-> RequestId

request id of the request

-> Request

the Wai.Request object

-> (ByteString, Maybe Value)

the request body and parsed request

-> ByteString

the response bytes

-> ByteString

the compressed response bytes ^ TODO (from master): make the above two type represented

-> Maybe (DiffTime, DiffTime)

IO/network wait time and service time (respectively) for this request, if available.

-> Maybe CompressionType

possible compression type

-> [Header]

list of request headers

-> HttpLogMetadata m 
-> m () 

Instances

Instances details
HttpLog AppM Source # 
Instance details

Defined in Hasura.App

Associated Types

type ExtraHttpLogMetadata AppM Source #

HttpLog m => HttpLog (TraceT m) Source # 
Instance details

Defined in Hasura.Server.Logging

Associated Types

type ExtraHttpLogMetadata (TraceT m) Source #

HttpLog m => HttpLog (ExceptT e m) Source # 
Instance details

Defined in Hasura.Server.Logging

Associated Types

type ExtraHttpLogMetadata (ExceptT e m) Source #

HttpLog m => HttpLog (ReaderT r m) Source # 
Instance details

Defined in Hasura.Server.Logging

Associated Types

type ExtraHttpLogMetadata (ReaderT r m) Source #

data HttpInfoLog Source #

Log information about the HTTP request

Constructors

HttpInfoLog 

data OperationLog Source #

Information about a GraphQL/Hasura metadata operation over HTTP

Constructors

OperationLog 

Fields

Instances

Instances details
ToJSON OperationLog Source # 
Instance details

Defined in Hasura.Server.Logging

Generic OperationLog Source # 
Instance details

Defined in Hasura.Server.Logging

Associated Types

type Rep OperationLog :: Type -> Type #

Eq OperationLog Source # 
Instance details

Defined in Hasura.Server.Logging

type Rep OperationLog Source # 
Instance details

Defined in Hasura.Server.Logging

mkHttpAccessLogContext Source #

Arguments

:: Maybe UserInfo

Maybe because it may not have been resolved

-> LoggingSettings 
-> RequestId 
-> Request 
-> (ByteString, Maybe Value) 
-> Int64

Size of response body, before compression

-> ByteString 
-> Maybe (DiffTime, DiffTime) 
-> Maybe CompressionType 
-> [Header] 
-> RequestMode 
-> Maybe (GQLBatchedReqs GQLBatchQueryOperationLog) 
-> HttpLogContext 

mkHttpErrorLogContext Source #

Arguments

:: Maybe UserInfo

Maybe because it may not have been resolved

-> LoggingSettings 
-> RequestId 
-> Request 
-> (ByteString, Maybe Value) 
-> QErr 
-> Maybe (DiffTime, DiffTime) 
-> Maybe CompressionType 
-> [Header] 
-> HttpLogContext 

mkHttpLog :: HttpLogContext -> HttpLogLine Source #

logDeprecatedEnvVars :: Logger Hasura -> Environment -> SourceCache -> IO () Source #

Log warning messages for deprecated environment variables