graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Server.Logging

Description

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

Synopsis

Documentation

data StartupLog Source #

Constructors

StartupLog 

Fields

Instances

Instances details
Eq StartupLog Source # 
Instance details

Defined in Hasura.Server.Logging

ToJSON StartupLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: StartupLog -> Value

toEncoding :: StartupLog -> Encoding

toJSONList :: [StartupLog] -> Value

toEncodingList :: [StartupLog] -> Encoding

ToEngineLog StartupLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

data PGLog Source #

Constructors

PGLog 

Fields

Instances

Instances details
Eq PGLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

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

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

ToJSON PGLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: PGLog -> Value

toEncoding :: PGLog -> Encoding

toJSONList :: [PGLog] -> Value

toEncodingList :: [PGLog] -> Encoding

ToEngineLog PGLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

data MetadataLog Source #

Constructors

MetadataLog 

Fields

Instances

Instances details
Eq MetadataLog Source # 
Instance details

Defined in Hasura.Server.Logging

ToJSON MetadataLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: MetadataLog -> Value

toEncoding :: MetadataLog -> Encoding

toJSONList :: [MetadataLog] -> Value

toEncodingList :: [MetadataLog] -> Encoding

ToEngineLog MetadataLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

data WebHookLog Source #

Constructors

WebHookLog 

Fields

Instances

Instances details
ToJSON WebHookLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: WebHookLog -> Value

toEncoding :: WebHookLog -> Encoding

toJSONList :: [WebHookLog] -> Value

toEncodingList :: [WebHookLog] -> Encoding

ToEngineLog WebHookLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

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

Instances

Instances details
Eq RequestMode Source # 
Instance details

Defined in Hasura.Server.Logging

ToJSON RequestMode Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: RequestMode -> Value

toEncoding :: RequestMode -> Encoding

toJSONList :: [RequestMode] -> Value

toEncodingList :: [RequestMode] -> Encoding

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 -> 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

-> 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 m => HttpLog (TraceT m) Source # 
Instance details

Defined in Hasura.Server.Logging

Associated Types

type ExtraHttpLogMetadata (TraceT m) Source #

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

Defined in Hasura.Server.Logging

MonadIO m => HttpLog (PGMetadataStorageAppT m) Source # 
Instance details

Defined in Hasura.App

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 

Fields

Instances

Instances details
Eq HttpInfoLog Source # 
Instance details

Defined in Hasura.Server.Logging

ToJSON HttpInfoLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: HttpInfoLog -> Value

toEncoding :: HttpInfoLog -> Encoding

toJSONList :: [HttpInfoLog] -> Value

toEncodingList :: [HttpInfoLog] -> Encoding

data OperationLog Source #

Information about a GraphQL/Hasura metadata operation over HTTP

Constructors

OperationLog 

Fields

Instances

Instances details
Eq OperationLog Source # 
Instance details

Defined in Hasura.Server.Logging

ToJSON OperationLog Source # 
Instance details

Defined in Hasura.Server.Logging

Methods

toJSON :: OperationLog -> Value

toEncoding :: OperationLog -> Encoding

toJSONList :: [OperationLog] -> Value

toEncodingList :: [OperationLog] -> Encoding

data BatchOperationSuccessLog Source #

BatchOperationSuccessLog contains the information required for a single successful operation in a batch request for OSS. This type is a subset of the GQLQueryOperationSuccessLog

data BatchOperationErrorLog Source #

BatchOperationSuccessLog contains the information required for a single erroneous operation in a batch request for OSS. This type is a subset of the GQLQueryOperationErrorLog

Constructors

BatchOperationErrorLog 

Fields

isQueryIncludedInLogs :: Text -> LoggingSettings -> Bool Source #

Check if the query field should be included in the http-log

mkHttpAccessLogContext Source #

Arguments

:: Maybe UserInfo

Maybe because it may not have been resolved

-> LoggingSettings 
-> RequestId 
-> Request 
-> (ByteString, Maybe Value) 
-> 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 

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

Log warning messages for deprecated environment variables