graphql-engine/server/src-lib/Hasura
Swann Moreau 04a87970f4 server: sanitise event trigger logs (fix #1233)
- sanitise the response field in event trigger and scheduled trigger logs, removing the body and the headers
- flatten the log structure to include the event id at `$.detail.event_id` instead of `$.detail.context.event_id`

the log format changes as follows:
```diff
diff --git a/log b/log
index 96127e0..1fb909a 100644
--- a/log
+++ b/log
@@ -1,48 +1,15 @@
 {
   "detail": {
-    "context": {
-      "event_id": "b9d4e627-6029-43f2-9d46-31c532b07070"
-    },
+    "event_id": "adcc8dcd-2f32-4554-bd55-90c787aee137",
     "request": {
       "size": 416
     },
     "response": {
-      "body": "{\n  \"args\": {}, \n  \"data\": \"{\\\"event\\\":{\\\"session_variables\\\":{\\\"x-hasura-role\\\":\\\"admin\\\"},\\\"op\\\":\\\"INSERT\\\",\\\"data\\\":{\\\"old\\\":null,\\\"new\\\":{\\\"name\\\":\\\"someotheranimal\\\",\\\"id\\\":3}},\\\"trace_context\\\":{\\\"trace_id\\\":\\\"e8237c03de151634\\\",\\\"span_id\\\":\\\"8c5f8952e9e06da8\\\"}},\\\"created_at\\\":\\\"2021-05-06T07:52:58.796611Z\\\",\\\"id>
-      "headers": [
-        {
-          "name": "Date",
-          "value": "Thu, 06 May 2021 07:53:00 GMT"
-        },
-        {
-          "name": "Content-Type",
-          "value": "application/json"
-        },
-        {
-          "name": "Content-Length",
-          "value": "1692"
-        },
-        {
-          "name": "Connection",
-          "value": "keep-alive"
-        },
-        {
-          "name": "Server",
-          "value": "gunicorn/19.9.0"
-        },
-        {
-          "name": "Access-Control-Allow-Origin",
-          "value": "*"
-        },
-        {
-          "name": "Access-Control-Allow-Credentials",
-          "value": "true"
-        }
-      ],
-      "size": 1692,
+      "size": 1719,
       "status": 200
     }
   },
   "level": "info",
-  "timestamp": "2021-05-06T13:23:00.376+0530",
+  "timestamp": "2021-05-06T13:25:14.481+0530",
   "type": "event-trigger"
 }
```

GitOrigin-RevId: d9622de366737da04dc6d9ff73238be16ec9305e
2021-05-12 12:10:53 +00:00
..
Backends server: fix single char SQL generation (fixes hasura/graphql-engine#6814) 2021-05-11 23:28:30 +00:00
Base server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Cache server: cleanup of language extensions [gardening] 2021-04-16 06:55:56 +00:00
Eventing server: sanitise event trigger logs (fix #1233) 2021-05-12 12:10:53 +00:00
GraphQL server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Incremental server: cleanup of language extensions [gardening] 2021-04-16 06:55:56 +00:00
Metadata server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
RQL pro: restrict GQL operations based on node limits 2021-05-12 06:25:45 +00:00
Server server: sanitise event trigger logs (fix #1233) 2021-05-12 12:10:53 +00:00
SQL server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
App.hs server: sanitise event trigger logs (fix #1233) 2021-05-12 12:10:53 +00:00
EncJSON.hs server: heterogeneous execution of GraphQL queries (#5869) 2020-10-07 10:23:17 +00:00
GC.hs server: simplify shutdown logic, improve resource management (#218) (#195) 2020-12-21 18:56:57 +00:00
HTTP.hs improve debug information in actions errors response (close #4031) (#4432) 2020-04-24 13:25:51 +05:30
Incremental.hs Build the GraphQL context after pruning dangling dependents 2020-01-30 18:17:29 -06:00
Logging.hs server: generalized LogQueryLog (fix #708) 2021-03-13 14:41:44 +00:00
Prelude.hs Adds support for client postgres certificates to multitenant 2021-04-13 00:16:34 +00:00
Session.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Tracing.hs server: cleanup of language extensions [gardening] 2021-04-16 06:55:56 +00:00