Skip to content

Commit

Permalink
stop logging /metrics hits
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdtangent committed Mar 18, 2021
1 parent c68dea2 commit 0c61e06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion middleware.go
Expand Up @@ -159,7 +159,8 @@ func (l *Logger) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// we've been around the block, grab that logger back from the context to log with
logger := log.Ctx(r.Context())

if r.URL.String() != "/ping" {
// don't logs these, no reason to
if r.URL.String() != "/ping" && r.URL.String() != "/metrics" {
logger.Info().
Stringer("url", r.URL).
Int("status_code", 200).
Expand Down

0 comments on commit 0c61e06

Please sign in to comment.