Delete healthz log (#525)

Silencing the healthz logs.
This commit is contained in:
smruthi2187
2018-03-02 15:50:48 -08:00
committed by GitHub
parent d852ddd91c
commit a3826046a5
6 changed files with 25 additions and 11 deletions
+14
View File
@@ -19,10 +19,14 @@ package fission
import (
"fmt"
"net"
"net/http"
"os"
"os/signal"
"runtime/debug"
"strings"
"syscall"
"github.com/gorilla/handlers"
)
func UrlForFunction(name string) string {
@@ -52,3 +56,13 @@ func IsNetworkError(err error) bool {
func GetFunctionIstioServiceName(fnName, fnNamespace string) string {
return fmt.Sprintf("istio-%v-%v", fnName, fnNamespace)
}
func LoggingMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requestURI := r.RequestURI
if !strings.Contains(requestURI, "healthz") {
// Call the next handler, which can be another middleware in the chain, or the final handler.
handlers.LoggingHandler(os.Stdout, next).ServeHTTP(w, r)
}
})
}