소스 검색

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: