mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #3575 from piotr1212/no_username_in_render_logging
Fix empty username in http log for /render calls
This commit is contained in:
commit
fabaf5cc04
@ -29,14 +29,14 @@ func Logger() macaron.Handler {
|
|||||||
return func(res http.ResponseWriter, req *http.Request, c *macaron.Context) {
|
return func(res http.ResponseWriter, req *http.Request, c *macaron.Context) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
rw := res.(macaron.ResponseWriter)
|
|
||||||
c.Next()
|
|
||||||
|
|
||||||
uname := c.GetCookie(setting.CookieUserName)
|
uname := c.GetCookie(setting.CookieUserName)
|
||||||
if len(uname) == 0 {
|
if len(uname) == 0 {
|
||||||
uname = "-"
|
uname = "-"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rw := res.(macaron.ResponseWriter)
|
||||||
|
c.Next()
|
||||||
|
|
||||||
content := fmt.Sprintf("Completed %s %s \"%s %s %s\" %v %s %d bytes in %dus", c.RemoteAddr(), uname, req.Method, req.URL.Path, req.Proto, rw.Status(), http.StatusText(rw.Status()), rw.Size(), time.Since(start)/time.Microsecond)
|
content := fmt.Sprintf("Completed %s %s \"%s %s %s\" %v %s %d bytes in %dus", c.RemoteAddr(), uname, req.Method, req.URL.Path, req.Proto, rw.Status(), http.StatusText(rw.Status()), rw.Size(), time.Since(start)/time.Microsecond)
|
||||||
|
|
||||||
switch rw.Status() {
|
switch rw.Status() {
|
||||||
|
Loading…
Reference in New Issue
Block a user