aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/sendevent.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-03-09 14:37:51 +0000
committerGitHub <noreply@github.com>2020-03-09 14:37:51 +0000
commitcdc115778551af69b4c9c39f758adcae61701aa3 (patch)
treec8e34df17c9ee61de48ad8a32d0d99b71941604d /clientapi/routing/sendevent.go
parentc31cb0227111ab4441d6282081ebd6494a422ba8 (diff)
Improve logging when sending events (#883)
We have some failing sytests on sqlite but it's very difficult to debug due to lack of useful logging. This adds a log line for when a new event is sent (incl. logging the event ID) as well as adding a user_id field for all contextual logs so we know who initiated certain actions.
Diffstat (limited to 'clientapi/routing/sendevent.go')
-rw-r--r--clientapi/routing/sendevent.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go
index 47ad1882..da96c5c6 100644
--- a/clientapi/routing/sendevent.go
+++ b/clientapi/routing/sendevent.go
@@ -77,6 +77,7 @@ func SendEvent(
util.GetLogger(req.Context()).WithError(err).Error("producer.SendEvents failed")
return jsonerror.InternalServerError()
}
+ util.GetLogger(req.Context()).WithField("event_id", eventID).Info("Sent event")
res := util.JSONResponse{
Code: http.StatusOK,