diff --git a/clientapi/routing/sendtodevice.go b/clientapi/routing/sendtodevice.go index 0c0227937..0dd1d2621 100644 --- a/clientapi/routing/sendtodevice.go +++ b/clientapi/routing/sendtodevice.go @@ -17,6 +17,7 @@ import ( "net/http" "github.com/matrix-org/util" + "github.com/sirupsen/logrus" "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" @@ -55,6 +56,13 @@ func SendToDevice( util.GetLogger(req.Context()).WithError(err).Error("eduProducer.SendToDevice failed") return jsonerror.InternalServerError() } + logrus.WithFields(logrus.Fields{ + "to_device_id": deviceID, + "to_user_id": userID, + "from_user_id": device.UserID, + "from_device_id": device.ID, + "type": eventType, + }).Debug("to-device-message sent") } } diff --git a/syncapi/streams/stream_sendtodevice.go b/syncapi/streams/stream_sendtodevice.go index 00b67cc42..2febd4599 100644 --- a/syncapi/streams/stream_sendtodevice.go +++ b/syncapi/streams/stream_sendtodevice.go @@ -5,6 +5,7 @@ import ( "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/types" + "github.com/sirupsen/logrus" ) type SendToDeviceStreamProvider struct { @@ -54,6 +55,12 @@ func (p *SendToDeviceStreamProvider) IncrementalSync( continue } req.Response.ToDevice.Events = append(req.Response.ToDevice.Events, event.SendToDeviceEvent) + logrus.WithFields(logrus.Fields{ + "to_device_id": req.Device.ID, + "to_user_id": req.Device.UserID, + "from_user_id": event.Sender, + "type": event.Type, + }).Debug("to-device-message received") } return lastPos