Skip to content

Commit

Permalink
use %f instead of %d for latency logging (#167)
Browse files Browse the repository at this point in the history
Fixing log formatting statement for latency
  • Loading branch information
robinjoseph08 authored and jrnt30 committed Sep 8, 2018
1 parent a0faa58 commit 8dc96cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (h *appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
latencyNanoseconds := timeSecs * 1e9
if r.URL.Path != "/healthz" {
logger.WithFields(log.Fields{"res.duration": latencyNanoseconds, "res.status": rw.statusCode}).
Infof("%s %s (%d) took %d ns", r.Method, r.URL.Path, rw.statusCode, latencyNanoseconds)
Infof("%s %s (%d) took %f ns", r.Method, r.URL.Path, rw.statusCode, latencyNanoseconds)
}
}

Expand Down

0 comments on commit 8dc96cf

Please sign in to comment.