[SEBA-356] Sadis-server logs to kafka
Change-Id: Ia1473621e5f8c12818fff6d4dffe708f3cc146cd
diff --git a/handlers.go b/handlers.go
index c85f239..fc28647 100644
--- a/handlers.go
+++ b/handlers.go
@@ -15,6 +15,7 @@
import (
"encoding/json"
+ "github.com/sirupsen/logrus"
"net"
"net/http"
"strconv"
@@ -26,7 +27,9 @@
vars := mux.Vars(r)
sadisRequestID := vars["id"]
- log.Infof("Looking for object %s in XOS database", sadisRequestID)
+ log.WithFields(logrus.Fields{
+ "sadisId": sadisRequestID,
+ }).Infof("Looking for object %s in XOS database", sadisRequestID)
defer r.Body.Close()
@@ -112,7 +115,9 @@
}
}
- log.Infof("Couldn't find object %s in XOS database", sadisRequestID)
+ log.WithFields(logrus.Fields{
+ "sadisId": sadisRequestID,
+ }).Infof("Couldn't find object %s in XOS database", sadisRequestID)
http.NotFound(w, r)
}