aboutsummaryrefslogtreecommitdiffhomepage
path: root/admin.go
diff options
context:
space:
mode:
authorDave Henderson <[email protected]>2020-09-25 20:00:08 -0400
committerGitHub <[email protected]>2020-09-25 18:00:08 -0600
commit85152679ce910d0993a2902ec00d199b8cc14e4d (patch)
treeb86811ca66395e621205d0d99d7f67d6d0a8e1f1 /admin.go
parenta33e4b542689cbe7ac711e3cfde1d2a30c0156ae (diff)
downloadcaddy-85152679ce910d0993a2902ec00d199b8cc14e4d.tar.gz
caddy-85152679ce910d0993a2902ec00d199b8cc14e4d.zip
admin: lower log level to Debug for /metrics requests (#3749)
* admin: lower log level to Debug for /metrics requests Signed-off-by: Dave Henderson <[email protected]> * Apply suggestions from code review Co-authored-by: Matt Holt <[email protected]> Co-authored-by: Matt Holt <[email protected]>
Diffstat (limited to 'admin.go')
-rw-r--r--admin.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/admin.go b/admin.go
index b2eb54237..8ac12fdac 100644
--- a/admin.go
+++ b/admin.go
@@ -311,13 +311,18 @@ type adminHandler struct {
// ServeHTTP is the external entry point for API requests.
// It will only be called once per request.
func (h adminHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- Log().Named("admin.api").Info("received request",
+ log := Log().Named("admin.api").With(
zap.String("method", r.Method),
zap.String("host", r.Host),
zap.String("uri", r.RequestURI),
zap.String("remote_addr", r.RemoteAddr),
zap.Reflect("headers", r.Header),
)
+ if r.RequestURI == "/metrics" {
+ log.Debug("received request")
+ } else {
+ log.Info("received request")
+ }
h.serveHTTP(w, r)
}