mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 16:32:28 +08:00
Fix http logging time_ms
unit is wrong (#8342)
In fact, the unit of `time_ms` int http logging is not "ms", this patch fix it.
This commit is contained in:

committed by
Torkel Ödegaard

parent
8c9cc4fae1
commit
b2c14b858e
@ -49,9 +49,9 @@ func Logger() macaron.Handler {
|
||||
if ctx, ok := c.Data["ctx"]; ok {
|
||||
ctxTyped := ctx.(*Context)
|
||||
if status == 500 {
|
||||
ctxTyped.Logger.Error("Request Completed", "method", req.Method, "path", req.URL.Path, "status", status, "remote_addr", c.RemoteAddr(), "time_ms", timeTakenMs, "size", rw.Size())
|
||||
ctxTyped.Logger.Error("Request Completed", "method", req.Method, "path", req.URL.Path, "status", status, "remote_addr", c.RemoteAddr(), "time_ms", int64(timeTakenMs), "size", rw.Size())
|
||||
} else {
|
||||
ctxTyped.Logger.Info("Request Completed", "method", req.Method, "path", req.URL.Path, "status", status, "remote_addr", c.RemoteAddr(), "time_ms", timeTakenMs, "size", rw.Size())
|
||||
ctxTyped.Logger.Info("Request Completed", "method", req.Method, "path", req.URL.Path, "status", status, "remote_addr", c.RemoteAddr(), "time_ms", int64(timeTakenMs), "size", rw.Size())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user