Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This is taken from wai-logger and customised for our use
Synopsis
- data StartupLog = StartupLog {}
- data PGLog = PGLog {
- plLogLevel :: !LogLevel
- plMessage :: !Value
- data MetadataLog = MetadataLog {}
- mkInconsMetadataLog :: [InconsistentMetadata] -> MetadataLog
- data WebHookLog = WebHookLog {
- whlLogLevel :: !LogLevel
- whlStatusCode :: !(Maybe Status)
- whlUrl :: !Text
- whlMethod :: !StdMethod
- whlError :: !(Maybe HttpException)
- whlResponse :: !(Maybe Text)
- whlMessage :: !(Maybe Text)
- data GQLQueryOperationSuccessLog = GQLQueryOperationSuccessLog {}
- data GQLQueryOperationErrorLog = GQLQueryOperationErrorLog {
- gqelQuery :: !GQLReqUnparsed
- gqelError :: !QErr
- data GQLBatchQueryOperationLog
- data RequestMode
- data CommonHttpLogMetadata = CommonHttpLogMetadata {}
- type HttpLogGraphQLInfo = (CommonHttpLogMetadata, ParameterizedQueryHashList)
- emptyHttpLogGraphQLInfo :: HttpLogGraphQLInfo
- type HttpLogMetadata m = (CommonHttpLogMetadata, ExtraHttpLogMetadata m)
- buildHttpLogMetadata :: forall m. HttpLog m => HttpLogGraphQLInfo -> ExtraUserInfo -> HttpLogMetadata m
- emptyHttpLogMetadata :: forall m. HttpLog m => HttpLogMetadata m
- data MetadataQueryLoggingMode
- data LoggingSettings = LoggingSettings {}
- class Monad m => HttpLog m where
- type ExtraHttpLogMetadata m
- emptyExtraHttpLogMetadata :: ExtraHttpLogMetadata m
- buildExtraHttpLogMetadata :: ParameterizedQueryHashList -> ExtraUserInfo -> ExtraHttpLogMetadata m
- logHttpError :: Logger Hasura -> LoggingSettings -> Maybe UserInfo -> RequestId -> Request -> (ByteString, Maybe Value) -> QErr -> [Header] -> HttpLogMetadata m -> m ()
- logHttpSuccess :: Logger Hasura -> LoggingSettings -> Maybe UserInfo -> RequestId -> Request -> (ByteString, Maybe Value) -> ByteString -> ByteString -> Maybe (DiffTime, DiffTime) -> Maybe CompressionType -> [Header] -> HttpLogMetadata m -> m ()
- data HttpInfoLog = HttpInfoLog {
- hlStatus :: !Status
- hlMethod :: !Text
- hlSource :: !IpAddress
- hlPath :: !Text
- hlHttpVersion :: !HttpVersion
- hlCompression :: !(Maybe CompressionType)
- hlHeaders :: ![Header]
- data OperationLog = OperationLog {
- olRequestId :: !RequestId
- olUserVars :: !(Maybe SessionVariables)
- olResponseSize :: !(Maybe Int64)
- olUncompressedResponseSize :: !Int64
- olRequestReadTime :: !(Maybe Seconds)
- olQueryExecutionTime :: !(Maybe Seconds)
- olQuery :: !(Maybe Value)
- olRawQuery :: !(Maybe Text)
- olError :: !(Maybe QErr)
- olRequestMode :: !RequestMode
- data HttpLogContext = HttpLogContext {
- hlcHttpInfo :: !HttpInfoLog
- hlcOperation :: !OperationLog
- hlcRequestId :: !RequestId
- hlcBatchedOperations :: !(Maybe (NonEmpty BatchOperationLog))
- mkHttpAccessLogContext :: Maybe UserInfo -> LoggingSettings -> RequestId -> Request -> (ByteString, Maybe Value) -> Int64 -> ByteString -> Maybe (DiffTime, DiffTime) -> Maybe CompressionType -> [Header] -> RequestMode -> Maybe (GQLBatchedReqs GQLBatchQueryOperationLog) -> HttpLogContext
- mkHttpErrorLogContext :: Maybe UserInfo -> LoggingSettings -> RequestId -> Request -> (ByteString, Maybe Value) -> QErr -> Maybe (DiffTime, DiffTime) -> Maybe CompressionType -> [Header] -> HttpLogContext
- mkHttpLog :: HttpLogContext -> HttpLogLine
- logDeprecatedEnvVars :: Logger Hasura -> Environment -> SourceCache -> IO ()
- data SchemaSyncThreadType
- data SchemaSyncLog = SchemaSyncLog {}
Documentation
data StartupLog Source #
Instances
ToJSON StartupLog Source # | |
Defined in Hasura.Server.Logging toJSON :: StartupLog -> Value Source # toEncoding :: StartupLog -> Encoding Source # toJSONList :: [StartupLog] -> Value Source # toEncodingList :: [StartupLog] -> Encoding Source # | |
Eq StartupLog Source # | |
Defined in Hasura.Server.Logging (==) :: StartupLog -> StartupLog -> Bool # (/=) :: StartupLog -> StartupLog -> Bool # | |
ToEngineLog StartupLog Hasura Source # | |
Defined in Hasura.Server.Logging toEngineLog :: StartupLog -> (LogLevel, EngineLogType Hasura, Value) Source # |
PGLog | |
|
data MetadataLog Source #
Instances
ToJSON MetadataLog Source # | |
Defined in Hasura.Server.Logging toJSON :: MetadataLog -> Value Source # toEncoding :: MetadataLog -> Encoding Source # toJSONList :: [MetadataLog] -> Value Source # toEncodingList :: [MetadataLog] -> Encoding Source # | |
Eq MetadataLog Source # | |
Defined in Hasura.Server.Logging (==) :: MetadataLog -> MetadataLog -> Bool # (/=) :: MetadataLog -> MetadataLog -> Bool # | |
ToEngineLog MetadataLog Hasura Source # | |
Defined in Hasura.Server.Logging toEngineLog :: MetadataLog -> (LogLevel, EngineLogType Hasura, Value) Source # |
data WebHookLog Source #
WebHookLog | |
|
Instances
ToJSON WebHookLog Source # | |
Defined in Hasura.Server.Logging toJSON :: WebHookLog -> Value Source # toEncoding :: WebHookLog -> Encoding Source # toJSONList :: [WebHookLog] -> Value Source # toEncodingList :: [WebHookLog] -> Encoding Source # | |
ToEngineLog WebHookLog Hasura Source # | |
Defined in Hasura.Server.Logging toEngineLog :: WebHookLog -> (LogLevel, EngineLogType Hasura, Value) Source # |
data GQLQueryOperationSuccessLog Source #
GQLQueryOperationSuccessLog captures all the data required to construct an HTTP success log.
Instances
data GQLQueryOperationErrorLog Source #
GQLQueryOperationErrorLog captures the request along with the error message
Instances
ToJSON GQLQueryOperationErrorLog Source # | |
Defined in Hasura.Server.Logging | |
Generic GQLQueryOperationErrorLog Source # | |
Defined in Hasura.Server.Logging type Rep GQLQueryOperationErrorLog :: Type -> Type # | |
Eq GQLQueryOperationErrorLog Source # | |
Defined in Hasura.Server.Logging | |
type Rep GQLQueryOperationErrorLog Source # | |
Defined in Hasura.Server.Logging type Rep GQLQueryOperationErrorLog = D1 ('MetaData "GQLQueryOperationErrorLog" "Hasura.Server.Logging" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "GQLQueryOperationErrorLog" 'PrefixI 'True) (S1 ('MetaSel ('Just "gqelQuery") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GQLReqUnparsed) :*: S1 ('MetaSel ('Just "gqelError") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 QErr))) |
data GQLBatchQueryOperationLog Source #
GQLQueryOperationSuccess !GQLQueryOperationSuccessLog | |
GQLQueryOperationError !GQLQueryOperationErrorLog |
Instances
ToJSON GQLBatchQueryOperationLog Source # | |
Defined in Hasura.Server.Logging | |
Eq GQLBatchQueryOperationLog Source # | |
Defined in Hasura.Server.Logging |
data RequestMode Source #
whether a request is executed in batched mode or not
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
ToJSON RequestMode Source # | |
Defined in Hasura.Server.Logging toJSON :: RequestMode -> Value Source # toEncoding :: RequestMode -> Encoding Source # toJSONList :: [RequestMode] -> Value Source # toEncodingList :: [RequestMode] -> Encoding Source # | |
Eq RequestMode Source # | |
Defined in Hasura.Server.Logging (==) :: RequestMode -> RequestMode -> Bool # (/=) :: RequestMode -> RequestMode -> Bool # |
data CommonHttpLogMetadata Source #
Instances
Eq CommonHttpLogMetadata Source # | |
Defined in Hasura.Server.Logging (==) :: CommonHttpLogMetadata -> CommonHttpLogMetadata -> Bool # (/=) :: CommonHttpLogMetadata -> CommonHttpLogMetadata -> Bool # |
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.
buildHttpLogMetadata :: forall m. HttpLog m => HttpLogGraphQLInfo -> ExtraUserInfo -> HttpLogMetadata m Source #
emptyHttpLogMetadata :: forall m. HttpLog m => HttpLogMetadata m Source #
synonym for clarity, writing `emptyHttpLogMetadata m` instead of `def
(HttpLogMetadata m)`
data MetadataQueryLoggingMode Source #
Instances
FromJSON MetadataQueryLoggingMode Source # | |
Defined in Hasura.Server.Logging | |
ToJSON MetadataQueryLoggingMode Source # | |
Defined in Hasura.Server.Logging | |
Show MetadataQueryLoggingMode Source # | |
Defined in Hasura.Server.Logging showsPrec :: Int -> MetadataQueryLoggingMode -> ShowS # show :: MetadataQueryLoggingMode -> String # showList :: [MetadataQueryLoggingMode] -> ShowS # | |
Eq MetadataQueryLoggingMode Source # | |
Defined in Hasura.Server.Logging | |
FromEnv MetadataQueryLoggingMode Source # | |
Defined in Hasura.Server.Init.Env |
data LoggingSettings Source #
Setting used to control the information in logs
LoggingSettings | |
|
Instances
Eq LoggingSettings Source # | |
Defined in Hasura.Server.Logging (==) :: LoggingSettings -> LoggingSettings -> Bool # (/=) :: LoggingSettings -> LoggingSettings -> Bool # |
class Monad m => HttpLog m where Source #
type ExtraHttpLogMetadata m Source #
Extra http-log metadata that we attach when operating in m
.
emptyExtraHttpLogMetadata :: ExtraHttpLogMetadata m Source #
buildExtraHttpLogMetadata :: ParameterizedQueryHashList -> ExtraUserInfo -> ExtraHttpLogMetadata m Source #
:: 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 () |
:: 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
data HttpInfoLog Source #
Log information about the HTTP request
HttpInfoLog | |
|
Instances
ToJSON HttpInfoLog Source # | |
Defined in Hasura.Server.Logging toJSON :: HttpInfoLog -> Value Source # toEncoding :: HttpInfoLog -> Encoding Source # toJSONList :: [HttpInfoLog] -> Value Source # toEncodingList :: [HttpInfoLog] -> Encoding Source # | |
Eq HttpInfoLog Source # | |
Defined in Hasura.Server.Logging (==) :: HttpInfoLog -> HttpInfoLog -> Bool # (/=) :: HttpInfoLog -> HttpInfoLog -> Bool # |
data OperationLog Source #
Information about a GraphQL/Hasura metadata operation over HTTP
OperationLog | |
|
Instances
data HttpLogContext Source #
HttpLogContext | |
|
Instances
ToJSON HttpLogContext Source # | |
Defined in Hasura.Server.Logging toJSON :: HttpLogContext -> Value Source # toEncoding :: HttpLogContext -> Encoding Source # toJSONList :: [HttpLogContext] -> Value Source # toEncodingList :: [HttpLogContext] -> Encoding Source # | |
Generic HttpLogContext Source # | |
Defined in Hasura.Server.Logging type Rep HttpLogContext :: Type -> Type # from :: HttpLogContext -> Rep HttpLogContext x # to :: Rep HttpLogContext x -> HttpLogContext # | |
Eq HttpLogContext Source # | |
Defined in Hasura.Server.Logging (==) :: HttpLogContext -> HttpLogContext -> Bool # (/=) :: HttpLogContext -> HttpLogContext -> Bool # | |
type Rep HttpLogContext Source # | |
Defined in Hasura.Server.Logging |
mkHttpAccessLogContext Source #
:: 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 #
:: 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
data SchemaSyncThreadType Source #
Instances
Show SchemaSyncThreadType Source # | |
Defined in Hasura.Server.Logging showsPrec :: Int -> SchemaSyncThreadType -> ShowS # show :: SchemaSyncThreadType -> String # showList :: [SchemaSyncThreadType] -> ShowS # | |
Eq SchemaSyncThreadType Source # | |
Defined in Hasura.Server.Logging (==) :: SchemaSyncThreadType -> SchemaSyncThreadType -> Bool # (/=) :: SchemaSyncThreadType -> SchemaSyncThreadType -> Bool # |
data SchemaSyncLog Source #
Instances
ToJSON SchemaSyncLog Source # | |
Defined in Hasura.Server.Logging toJSON :: SchemaSyncLog -> Value Source # toEncoding :: SchemaSyncLog -> Encoding Source # toJSONList :: [SchemaSyncLog] -> Value Source # toEncodingList :: [SchemaSyncLog] -> Encoding Source # | |
Show SchemaSyncLog Source # | |
Defined in Hasura.Server.Logging showsPrec :: Int -> SchemaSyncLog -> ShowS # show :: SchemaSyncLog -> String # showList :: [SchemaSyncLog] -> ShowS # | |
Eq SchemaSyncLog Source # | |
Defined in Hasura.Server.Logging (==) :: SchemaSyncLog -> SchemaSyncLog -> Bool # (/=) :: SchemaSyncLog -> SchemaSyncLog -> Bool # | |
ToEngineLog SchemaSyncLog Hasura Source # | |
Defined in Hasura.Server.Logging toEngineLog :: SchemaSyncLog -> (LogLevel, EngineLogType Hasura, Value) Source # |