Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module holds functions and data types used for logging at the GraphQL layer. Unlike QueryLog, these are fired after queries are finished so could include things like execution time in future.
Synopsis
- data ExecutionLog = ExecutionLog {
- _elRequestId :: !RequestId
- _elStatistics :: !(Maybe (AnyBackend ExecutionStats))
- newtype ExecutionStats b = ExecutionStats (ExecutionStatistics b)
- statsToAnyBackend :: forall b. HasTag b => ActionResult b -> (Maybe (AnyBackend ExecutionStats), EncJSON)
- class Monad m => MonadExecutionLog m where
- logExecutionLog :: Logger Hasura -> ExecutionLog -> m ()
Documentation
data ExecutionLog Source #
A GraphQL query, optionally generated SQL, and the request id makes up the
| ExecutionLog
Instances
ToJSON ExecutionLog Source # | |
Defined in Hasura.GraphQL.Logging.ExecutionLog toJSON :: ExecutionLog -> Value Source # toEncoding :: ExecutionLog -> Encoding Source # toJSONList :: [ExecutionLog] -> Value Source # toEncodingList :: [ExecutionLog] -> Encoding Source # | |
ToEngineLog ExecutionLog Hasura Source # | |
Defined in Hasura.GraphQL.Logging.ExecutionLog toEngineLog :: ExecutionLog -> (LogLevel, EngineLogType Hasura, Value) Source # |
newtype ExecutionStats b Source #
ExecutionStatistics
is a type family, which means we can't partially
apply it (in AnyBackend
, for example). To get round this, we have a
newtype that really just wraps the type family.
Instances
Backend b => ToJSON (ExecutionStats b) Source # | |
Defined in Hasura.GraphQL.Logging.ExecutionLog toJSON :: ExecutionStats b -> Value Source # toEncoding :: ExecutionStats b -> Encoding Source # toJSONList :: [ExecutionStats b] -> Value Source # toEncodingList :: [ExecutionStats b] -> Encoding Source # |
statsToAnyBackend :: forall b. HasTag b => ActionResult b -> (Maybe (AnyBackend ExecutionStats), EncJSON) Source #
When we want to log anything from DBStepInfo
, we first need to transform
the backend-specific execution statistics into AnyBackend
statistics. This
is fine in practice because all we do with it is log it as JSON.
class Monad m => MonadExecutionLog m where Source #
logExecutionLog :: Logger Hasura -> ExecutionLog -> m () Source #
Instances
MonadExecutionLog AppM Source # | |
Defined in Hasura.App logExecutionLog :: Logger Hasura -> ExecutionLog -> AppM () Source # | |
MonadExecutionLog m => MonadExecutionLog (Handler m) Source # | |
Defined in Hasura.Server.App logExecutionLog :: Logger Hasura -> ExecutionLog -> Handler m () Source # | |
MonadExecutionLog m => MonadExecutionLog (TraceT m) Source # | |
Defined in Hasura.GraphQL.Logging.ExecutionLog logExecutionLog :: Logger Hasura -> ExecutionLog -> TraceT m () Source # | |
MonadExecutionLog m => MonadExecutionLog (ExceptT e m) Source # | |
Defined in Hasura.GraphQL.Logging.ExecutionLog logExecutionLog :: Logger Hasura -> ExecutionLog -> ExceptT e m () Source # | |
MonadExecutionLog m => MonadExecutionLog (ReaderT r m) Source # | |
Defined in Hasura.GraphQL.Logging.ExecutionLog logExecutionLog :: Logger Hasura -> ExecutionLog -> ReaderT r m () Source # |