Files
management-refactor/internal/shared/api/rest/middleware/logging_middleware.go

13 lines
353 B
Go

package middleware
import "net/http"
// loggingMiddleware is an example that logs each incoming request.
// Replace with your logger of choice.
func LoggingMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// log.Printf("[%s] %s", r.Method, r.URL.Path)
next.ServeHTTP(w, r)
})
}