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

Hasura.Logging

Synopsis

Documentation

class (Eq (EngineLogType impl), Hashable (EngineLogType impl)) => EnabledLogTypes impl where Source #

Typeclass representing any type which can be parsed into a list of enabled log types, and has a Set of default enabled log types, and can find out if a log type is enabled

data family EngineLogType impl Source #

A family of EngineLogType types

Instances

Instances details
FromJSON (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

ToJSON (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Generic (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Associated Types

type Rep (EngineLogType Hasura) :: Type -> Type #

Show (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Eq (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

EnabledLogTypes impl => FromEnv (HashSet (EngineLogType impl)) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Hashable (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

From (EngineLogType Hasura) Text Source # 
Instance details

Defined in Hasura.Logging

EnabledLogTypes impl => ToEngineLog (OpException, EngineLogType impl) impl Source # 
Instance details

Defined in Hasura.Logging

data EngineLogType Hasura Source # 
Instance details

Defined in Hasura.Logging

type Rep (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

type Rep (EngineLogType Hasura) = D1 ('MetaData "EngineLogType" "Hasura.Logging" "graphql-engine-1.0.0-inplace" 'False) (((C1 ('MetaCons "ELTHttpLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTWebsocketLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTWebhookLog" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ELTQueryLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTExecutionLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTStartup" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ELTLivequeryPollerLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTActionHandler" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTDataConnectorLog" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ELTJwkRefreshLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTValidateInputLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTInternal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InternalLogTypes))))))

data Hasura Source #

Instances

Instances details
EnabledLogTypes Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog ImmortalThreadLog Hasura Source # 
Instance details

Defined in Control.Concurrent.Extended

ToEngineLog ValidateInsertInputLog Hasura Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Mutation

ToEngineLog FetchedCronTriggerStats Hasura Source # 
Instance details

Defined in Hasura.Eventing.ScheduledTrigger.Types

ToEngineLog FetchedScheduledEventsStats Hasura Source # 
Instance details

Defined in Hasura.Eventing.ScheduledTrigger.Types

ToEngineLog ScheduledTriggerInternalErr Hasura Source # 
Instance details

Defined in Hasura.Eventing.ScheduledTrigger.Types

ToEngineLog ActionHandlerLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Execute.Action.Types

ToEngineLog PollDetails Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Execute.Subscription.Poll.Common

ToEngineLog ExecutionLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Logging.ExecutionLog

ToEngineLog QueryLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Logging.QueryLog

ToEngineLog WSLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Transport.WebSocket.Server

ToEngineLog StoredIntrospectionLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog StoredIntrospectionStorageLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog UnhandledInternalErrorLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog UnstructuredLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog JwkRefreshLog Hasura Source # 
Instance details

Defined in Hasura.Server.Auth.JWT.Logging

ToEngineLog MetadataLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog PGLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog SchemaSyncLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog StartupLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog WebHookLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog MigrationResult Hasura Source # 
Instance details

Defined in Hasura.Server.Migrate

FromJSON (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

ToJSON (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Generic (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Associated Types

type Rep (EngineLogType Hasura) :: Type -> Type #

Show (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Eq (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

Hashable (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog (HTTPErr 'EventType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPErr 'ScheduledType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPResp 'EventType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPResp 'ScheduledType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (DBObjectsIntrospection b) Hasura Source # 
Instance details

Defined in Hasura.RQL.Types.Source

From (EngineLogType Hasura) Text Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog (SourceName, SourceCatalogMigrationState) Hasura Source # 
Instance details

Defined in Hasura.Server.Migrate.Version

data EngineLogType Hasura Source # 
Instance details

Defined in Hasura.Logging

type Rep (EngineLogType Hasura) Source # 
Instance details

Defined in Hasura.Logging

type Rep (EngineLogType Hasura) = D1 ('MetaData "EngineLogType" "Hasura.Logging" "graphql-engine-1.0.0-inplace" 'False) (((C1 ('MetaCons "ELTHttpLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTWebsocketLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTWebhookLog" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ELTQueryLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTExecutionLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTStartup" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ELTLivequeryPollerLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTActionHandler" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTDataConnectorLog" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ELTJwkRefreshLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ELTValidateInputLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ELTInternal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InternalLogTypes))))))

data InternalLogTypes Source #

Constructors

ILTUnstructured

mostly for debug logs - see debugT, debugBS and debugLBS functions

ILTUnhandledInternalError 
ILTEventTrigger 
ILTEventTriggerProcess 
ILTScheduledTrigger 
ILTScheduledTriggerProcess 
ILTCronEventGeneratorProcess 
ILTWsServer

internal logs for the websocket server

ILTPgClient 
ILTMetadata

log type for logging metadata related actions; currently used in logging inconsistent metadata

ILTTelemetry 
ILTSchemaSync 
ILTSourceCatalogMigration 
ILTStoredIntrospection 
ILTStoredIntrospectionStorage 

Instances

Instances details
ToJSON InternalLogTypes Source # 
Instance details

Defined in Hasura.Logging

Generic InternalLogTypes Source # 
Instance details

Defined in Hasura.Logging

Associated Types

type Rep InternalLogTypes :: Type -> Type #

Show InternalLogTypes Source # 
Instance details

Defined in Hasura.Logging

Eq InternalLogTypes Source # 
Instance details

Defined in Hasura.Logging

Hashable InternalLogTypes Source # 
Instance details

Defined in Hasura.Logging

From InternalLogTypes Text Source # 
Instance details

Defined in Hasura.Logging

type Rep InternalLogTypes Source # 
Instance details

Defined in Hasura.Logging

type Rep InternalLogTypes = D1 ('MetaData "InternalLogTypes" "Hasura.Logging" "graphql-engine-1.0.0-inplace" 'False) (((C1 ('MetaCons "ILTUnstructured" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ILTUnhandledInternalError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTEventTrigger" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ILTEventTriggerProcess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTScheduledTrigger" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ILTScheduledTriggerProcess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTCronEventGeneratorProcess" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "ILTWsServer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTPgClient" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ILTMetadata" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTTelemetry" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ILTSchemaSync" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTSourceCatalogMigration" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ILTStoredIntrospection" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILTStoredIntrospectionStorage" 'PrefixI 'False) (U1 :: Type -> Type)))))

data EngineLog impl Source #

Constructors

EngineLog 

Fields

Instances

Instances details
ToJSON (EngineLogType impl) => ToJSON (EngineLog impl) Source # 
Instance details

Defined in Hasura.Logging

Generic (EngineLog impl) Source # 
Instance details

Defined in Hasura.Logging

Associated Types

type Rep (EngineLog impl) :: Type -> Type #

Methods

from :: EngineLog impl -> Rep (EngineLog impl) x #

to :: Rep (EngineLog impl) x -> EngineLog impl #

Show (EngineLogType impl) => Show (EngineLog impl) Source # 
Instance details

Defined in Hasura.Logging

Methods

showsPrec :: Int -> EngineLog impl -> ShowS #

show :: EngineLog impl -> String #

showList :: [EngineLog impl] -> ShowS #

Eq (EngineLogType impl) => Eq (EngineLog impl) Source # 
Instance details

Defined in Hasura.Logging

Methods

(==) :: EngineLog impl -> EngineLog impl -> Bool #

(/=) :: EngineLog impl -> EngineLog impl -> Bool #

type Rep (EngineLog impl) Source # 
Instance details

Defined in Hasura.Logging

type Rep (EngineLog impl)

class EnabledLogTypes impl => ToEngineLog a impl where Source #

Typeclass representing any data type that can be converted to EngineLog for the purpose of logging

Instances

Instances details
ToEngineLog ImmortalThreadLog Hasura Source # 
Instance details

Defined in Control.Concurrent.Extended

ToEngineLog ValidateInsertInputLog Hasura Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Mutation

ToEngineLog FetchedCronTriggerStats Hasura Source # 
Instance details

Defined in Hasura.Eventing.ScheduledTrigger.Types

ToEngineLog FetchedScheduledEventsStats Hasura Source # 
Instance details

Defined in Hasura.Eventing.ScheduledTrigger.Types

ToEngineLog ScheduledTriggerInternalErr Hasura Source # 
Instance details

Defined in Hasura.Eventing.ScheduledTrigger.Types

ToEngineLog ActionHandlerLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Execute.Action.Types

ToEngineLog PollDetails Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Execute.Subscription.Poll.Common

ToEngineLog ExecutionLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Logging.ExecutionLog

ToEngineLog QueryLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Logging.QueryLog

ToEngineLog WSLog Hasura Source # 
Instance details

Defined in Hasura.GraphQL.Transport.WebSocket.Server

ToEngineLog StoredIntrospectionLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog StoredIntrospectionStorageLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog UnhandledInternalErrorLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog UnstructuredLog Hasura Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog JwkRefreshLog Hasura Source # 
Instance details

Defined in Hasura.Server.Auth.JWT.Logging

ToEngineLog MetadataLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog PGLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog SchemaSyncLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog StartupLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog WebHookLog Hasura Source # 
Instance details

Defined in Hasura.Server.Logging

ToEngineLog MigrationResult Hasura Source # 
Instance details

Defined in Hasura.Server.Migrate

ToEngineLog (HTTPErr 'EventType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPErr 'ScheduledType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPResp 'EventType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (HTTPResp 'ScheduledType) Hasura Source # 
Instance details

Defined in Hasura.Eventing.HTTP

ToEngineLog (DBObjectsIntrospection b) Hasura Source # 
Instance details

Defined in Hasura.RQL.Types.Source

EnabledLogTypes impl => ToEngineLog (OpException, EngineLogType impl) impl Source # 
Instance details

Defined in Hasura.Logging

ToEngineLog (SourceName, SourceCatalogMigrationState) Hasura Source # 
Instance details

Defined in Hasura.Server.Migrate.Version

data LoggerCtx impl Source #

Constructors

LoggerCtx 

Unhandled Internal Errors

newtype UnhandledInternalErrorLog Source #

We expect situations where there are code paths that should not occur and we throw an error on this code paths. If our assumptions are incorrect and infact these errors do occur, we want to log them.

LoggerSettings

data LoggerSettings Source #

Constructors

LoggerSettings 

Fields

Instances

Instances details
Show LoggerSettings Source # 
Instance details

Defined in Hasura.Logging

Eq LoggerSettings Source # 
Instance details

Defined in Hasura.Logging

mkLoggerCtx :: (MonadIO io, MonadBaseControl IO io) => LoggerSettings -> HashSet (EngineLogType impl) -> ManagedT io (LoggerCtx impl) Source #

Creates a new LoggerCtx.

The underlying LoggerSet is bound to the ManagedT context: when it exits, the log will be flushed and cleared regardless of whether it was exited properly or not (ManagedT uses bracket underneath). This guarantees that the logs will always be flushed, even in case of error, avoiding a repeat of https://github.com/hasura/graphql-engine/issues/4772.

newtype Logger impl Source #

Constructors

Logger 

Fields

data StoredIntrospectionLog Source #

Emit when stored introspection is used

Constructors

StoredIntrospectionLog 

Fields

data StoredIntrospectionStorageLog Source #

Logs related to errors while interacting with the stored introspection storage

createStatsLogger :: forall m stats impl. (MonadIO m, ToEngineLog stats impl, Monoid stats) => Logger impl -> m (Trigger stats stats) Source #

A logger useful for accumulating and logging stats, in tight polling loops. It also debounces to not flood with excessive logs. Use @logStats to record statistics for logging.

closeStatsLogger :: (MonadIO m, EnabledLogTypes impl) => EngineLogType impl -> Logger impl -> Trigger stats stats -> m () Source #

Safely close the statistics logger. When occurred, exception is logged.

logStats :: MonadIO m => Trigger stats stats -> stats -> m () Source #

This won't log the given stats immediately. The stats are accumulated over the specific timeframe and logged only once. See @createStatsLogger for more details.