diff --git a/src/github.com/matrix-org/go-neb/api.go b/src/github.com/matrix-org/go-neb/api.go index ab75ee3..96b6f57 100644 --- a/src/github.com/matrix-org/go-neb/api.go +++ b/src/github.com/matrix-org/go-neb/api.go @@ -136,6 +136,7 @@ type webhookHandler struct { } func (wh *webhookHandler) handle(w http.ResponseWriter, req *http.Request) { + log.WithField("path", req.URL.RawPath).Print("Incoming webhook request") segments := strings.Split(req.URL.Path, "/") // last path segment is the service ID which we will pass the incoming request to, // but we've base64d it. @@ -164,8 +165,9 @@ func (wh *webhookHandler) handle(w http.ResponseWriter, req *http.Request) { return } log.WithFields(log.Fields{ - "service_id": service.ServiceID(), - }).Print("Incoming webhook") + "service_id": service.ServiceID(), + "service_typ": service.ServiceType(), + }).Print("Incoming webhook for service") service.OnReceiveWebhook(w, req, cli) } diff --git a/src/github.com/matrix-org/go-neb/services/github/github.go b/src/github.com/matrix-org/go-neb/services/github/github.go index 2becdcd..57e62e9 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github.go +++ b/src/github.com/matrix-org/go-neb/services/github/github.go @@ -292,6 +292,8 @@ func modifyWebhooks(s *githubService, cli *github.Client, removeHooks bool) { if err != nil { logger.WithError(err).Print("Failed to create webhook") // continue as others may succeed + } else { + logger.WithField("endpoint", s.webhookEndpointURL).Print("Created hook with endpoint") } } } @@ -396,6 +398,7 @@ func removeHook(logger *log.Entry, cli *github.Client, owner, repo, webhookEndpo } } if hook == nil { + logger.WithField("endpoint", webhookEndpointURL).Print("Failed to find hook with endpoint") return // couldn't find it } @@ -403,6 +406,7 @@ func removeHook(logger *log.Entry, cli *github.Client, owner, repo, webhookEndpo if err != nil { logger.WithError(err).Print("Failed to delete hook") } + logger.WithField("endpoint", webhookEndpointURL).Print("Deleted hook") } func init() {