From aba7b6c48d70c3267cd4aec6dcc7130385b3456a Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Wed, 20 Jul 2016 15:49:45 +0800 Subject: [PATCH] add debug log for notificaions --- service/notification.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/notification.go b/service/notification.go index 77ade18d3..df3a114f1 100644 --- a/service/notification.go +++ b/service/notification.go @@ -94,6 +94,9 @@ func filterEvents(notification *models.Notification) ([]*models.Event, error) { events := []*models.Event{} for _, event := range notification.Events { + log.Debugf("receive an event: ID-%s, target-%s:%s, digest-%s, action-%s", event.ID, event.Target.Repository, event.Target.Tag, + event.Target.Digest, event.Action) + isManifest, err := regexp.MatchString(manifestPattern, event.Target.MediaType) if err != nil { log.Errorf("failed to match the media type against pattern: %v", err) @@ -107,12 +110,14 @@ func filterEvents(notification *models.Notification) ([]*models.Event, error) { //pull and push manifest by docker-client if strings.HasPrefix(event.Request.UserAgent, "docker") && (event.Action == "pull" || event.Action == "push") { events = append(events, &event) + log.Debugf("add event to collect: %s", event.ID) continue } //push manifest by docker-client or job-service if strings.ToLower(strings.TrimSpace(event.Request.UserAgent)) == "harbor-registry-client" && event.Action == "push" { events = append(events, &event) + log.Debugf("add event to collect: %s", event.ID) continue } }