Skip to content

Commit

Permalink
Add logging about originating host and HTTP method used (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxia-wish authored Jul 30, 2021
1 parent c8ae3d2 commit 28cc28b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func registerRoutes(srv *Server) http.Handler {

func latency(prefix string, h httprouter.Handle) httprouter.Handle {
return func(w http.ResponseWriter, req *http.Request, ps httprouter.Params) {
log.Infof("request received for %s", prefix)
log.Infof("%s request received for %s from %s", req.Method, prefix, req.RemoteAddr)
start := time.Now()
defer func() {
metrics.HTTPLatency(prefix, start)
Expand Down

0 comments on commit 28cc28b

Please sign in to comment.