-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
When HASURA_GRAPHQL_LOG_LEVEL is set to debug, then log the request to and response from the action webhook call. The log-type of this should be action (similar to event-trigger log-type for event trigger responses). So it will look like (similar to event trigger logs)
{
"type":"action",
"timestamp":"2020-03-18T06:20:35.373+0000",
"level":"debug",
"detail":{
"context":{"action_id":"5d8a8bed-024c-40ca-9521-287c330f83c2"}, # any kind of context (for e.g. action_id for async actions)
"request":{"url": "", "body":"{}", "headers": []},
"response":{"status":200,"body":"{}", "headers": []}
}
}
Note on logging headers:
-
Request headers should be redacted based on whether the value is environment variable and should be over-rideable using
LOG_HEADERS_FROM_ENVenv flag. This infra already exists for Event Triggers -- seeandgraphql-engine/server/src-lib/Hasura/App.hs
Line 257 in 4d2dbe6
logEnvHeaders <- liftIO $ getFromEnv False "LOG_HEADERS_FROM_ENV" decodeHeader -
Header
Authorizationshould be redacted. -
Redacting response headers will be outside the scope of this spec. We can also choose to not log response headers till we spec this.