use logging mddleware from common-lib
tronnet/workflows: Static Analysis -- Golang / static-go (push) Successful in 16s
tronnet/workflows: Static Analysis -- Golang / static-go (push) Successful in 16s
This commit is contained in:
1 parent
612fbddb33
commit
072691569e
2 files changed
+2
-10
No files matched your search
+1
-9
@@ -170,16 +170,8 @@ func Run() {
|
||||
}
|
||||
})
|
||||
|
||||
server := LoggingMiddleware(router)
|
||||
server := paas.LoggingMiddleware(router)
|
||||
|
||||
log.Printf("[INFO] starting API listening on 0.0.0.0:%d", config.ListenPort)
|
||||
log.Fatalf("[ERR ] starting gin router: %s", http.ListenAndServe("0.0.0.0:"+strconv.Itoa(config.ListenPort), server))
|
||||
}
|
||||
|
||||
func LoggingMiddleware(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
start := time.Now()
|
||||
next.ServeHTTP(w, r)
|
||||
log.Printf("%s %s %s", r.Method, r.URL.Path, time.Since(start))
|
||||
})
|
||||
}
|
||||
+1
-1
Submodule proxmoxaas-common-lib updated: 35ecaf84e0...8b73652c9b.
Reference in new issue
Block a user