Commit 4ee9e48e by Carl Bergquist

Merge pull request #3405 from piotr1212/master

Add more info in route logging
parents 55fab049 207c1a20
...@@ -32,7 +32,12 @@ func Logger() macaron.Handler { ...@@ -32,7 +32,12 @@ func Logger() macaron.Handler {
rw := res.(macaron.ResponseWriter) rw := res.(macaron.ResponseWriter)
c.Next() c.Next()
content := fmt.Sprintf("Completed %s %v %s in %v", req.URL.Path, rw.Status(), http.StatusText(rw.Status()), time.Since(start)) uname := c.GetCookie(setting.CookieUserName)
if len(uname) == 0 {
uname = "-"
}
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() {
case 200, 304: case 200, 304:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment