PLT-3440 (#3440)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
6c5a8be6bf
Коммит
b63f61fe7d
@@ -6,6 +6,7 @@ package api
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
l4g "github.com/alecthomas/log4go"
|
||||
|
||||
@@ -27,11 +28,22 @@ func getClientConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func logClient(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
forceToDebug := false
|
||||
|
||||
if !*utils.Cfg.ServiceSettings.EnableDeveloper {
|
||||
forceToDebug = true
|
||||
}
|
||||
|
||||
m := model.MapFromJson(r.Body)
|
||||
|
||||
lvl := m["level"]
|
||||
msg := m["message"]
|
||||
|
||||
// filter out javascript errors from franz that are poluting the log files
|
||||
if strings.Contains(msg, "/franz") {
|
||||
forceToDebug = true
|
||||
}
|
||||
|
||||
if len(msg) > 400 {
|
||||
msg = msg[0:399]
|
||||
}
|
||||
@@ -41,7 +53,12 @@ func logClient(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
err.Message = msg
|
||||
err.Id = msg
|
||||
err.Where = "client"
|
||||
c.LogError(err)
|
||||
|
||||
if forceToDebug {
|
||||
c.LogDebug(err)
|
||||
} else {
|
||||
c.LogError(err)
|
||||
}
|
||||
}
|
||||
|
||||
ReturnStatusOK(w)
|
||||
|
||||
Ссылка в новой задаче
Block a user