docstore/pkg/server/webdav.go
2022-09-19 22:52:40 +02:00

27 lines
468 B
Go

// Copyright (C) 2022 Marius Schellenberger
package server
import (
"net/http"
"github.com/go-logr/logr"
)
func webdavLogger(log logr.Logger) func(r *http.Request, err error) {
return func(r *http.Request, err error) {
if err != nil {
log.Error(err, "access",
"client", r.RemoteAddr,
"method", r.Method,
"uri", r.URL.Path,
)
return
}
log.Info("access",
"client", r.RemoteAddr,
"method", r.Method,
"uri", r.URL.Path,
)
}
}