mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-04-29 18:42:28 +00:00
17 lines
351 B
Go
17 lines
351 B
Go
package middleware
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"npm/internal/logger"
|
|
)
|
|
|
|
// Log will print out route information to the logger
|
|
// only when debug is enabled
|
|
func Log(next http.Handler) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
logger.Debug("Request: %s %s", r.Method, r.URL.Path)
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|