浏览代码

fix(logging): fixed so that router_logging = true actually logs all http requests, fixes #2902

Torkel Ödegaard 10 年之前
父节点
当前提交
e873574e8c
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      pkg/middleware/logger.go

+ 4 - 1
pkg/middleware/logger.go

@@ -22,6 +22,7 @@ import (
 
 	"github.com/Unknwon/macaron"
 	"github.com/grafana/grafana/pkg/log"
+	"github.com/grafana/grafana/pkg/setting"
 )
 
 func Logger() macaron.Handler {
@@ -36,7 +37,9 @@ func Logger() macaron.Handler {
 		switch rw.Status() {
 		case 200, 304:
 			content = fmt.Sprintf("%s", content)
-			return
+			if !setting.RouterLogging {
+				return
+			}
 		case 404:
 			content = fmt.Sprintf("%s", content)
 		case 500: