1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: log request durations (resolve #102)

This commit is contained in:
Ferdinand Mütsch
2021-01-31 16:46:39 +01:00
parent 3e5a51c272
commit 665ffe8bd1
2 changed files with 121 additions and 9 deletions

View File

@@ -9,7 +9,9 @@ import (
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/migrations/common"
"github.com/muety/wakapi/repositories"
"log"
"net/http"
"os"
"strconv"
"time"
@@ -140,7 +142,10 @@ func main() {
// Middlewares
recoveryMiddleware := handlers.RecoveryHandler()
loggingMiddleware := middlewares.NewLoggingMiddleware().Handler
loggingMiddleware := middlewares.NewLoggingMiddleware(
// Use logbuch here once https://github.com/emvi/logbuch/issues/4 is realized
log.New(os.Stdout, "", 0),
)
corsMiddleware := handlers.CORS()
authenticateMiddleware := middlewares.NewAuthenticateMiddleware(
userService,