graphql-engine/server/src-lib/Hasura/Server
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
..
API server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Auth server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Init server: sanitise event trigger logs (fix #1233) 2021-05-12 12:10:53 +00:00
Migrate server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Telemetry server: cleanup of language extensions [gardening] 2021-04-16 06:55:56 +00:00
App.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Auth.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
CheckUpdates.hs server: simplify JSON instances 2021-01-19 19:15:42 +00:00
Compression.hs server: move Hasura.SQL to Hasura.Backends.Postgres (#6053) 2020-10-27 13:53:49 +00:00
Cors.hs server: support custom URI schemes in CORS config (fix #5818) 2021-05-06 00:53:14 +00:00
Init.hs server: sanitise event trigger logs (fix #1233) 2021-05-12 12:10:53 +00:00
Logging.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Middleware.hs Migrate to GHC 8.10, upgrade dependencies. Closes #4517 2020-05-13 19:13:02 -04:00
Migrate.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Rest.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
SchemaUpdate.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Telemetry.hs server: switch to a sub-backend approach 2021-04-21 21:45:32 +00:00
Types.hs server: fix the FromJSON instance of ExperimentalFeature 2021-03-16 11:49:00 +00:00
Utils.hs server: make postgres related ENV vars source specific 2021-04-28 16:50:14 +00:00
Version.hs server: use relative paths in TH splices 2021-03-16 17:36:39 +00:00