From a303600a9a95b4f467fffb7f2f8296da74ea5b09 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 28 Sep 2020 15:49:20 +0100 Subject: [PATCH] Logging --- federationapi/routing/send.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 0643242fb..f3b192c1c 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -369,15 +369,18 @@ func (t *txnReq) processEvent(ctx context.Context, e gomatrixserverlib.Event, is // TODO: Make this less bad for _, missingAuthEventID := range stateResp.MissingAuthEventIDs { + logrus.WithContext(ctx).Infof("Retrieving missing auth event %q", missingAuthEventID) if tx, err := t.federation.GetEvent(ctx, e.Origin(), missingAuthEventID); err == nil { ev, err := gomatrixserverlib.NewEventFromUntrustedJSON(tx.PDUs[0], stateResp.RoomVersion) if err != nil { - logrus.WithError(err).Warnf("Failed to unmarshal auth event %d", missingAuthEventID) + logrus.WithContext(ctx).WithError(err).Warnf("Failed to unmarshal auth event %d", missingAuthEventID) continue } if err = t.processEvent(ctx, ev, false); err != nil { - logrus.WithError(err).Warnf("Failed to process auth event %d", missingAuthEventID) + logrus.WithContext(ctx).WithError(err).Warnf("Failed to process auth event %d", missingAuthEventID) } + } else { + logrus.WithContext(ctx).WithError(err).Warnf("Failed to retrieve unknown auth event %q", missingAuthEventID) } }