summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMartin Kraft <martinkraft@gmail.com>2018-05-16 14:45:46 -0400
committerMartin Kraft <martinkraft@gmail.com>2018-05-16 14:45:46 -0400
commitf1a830ce9aea87fbeab7e54a6b2b56423e5fed45 (patch)
tree613bb2cb29cca3016d6b6ac75602aad26303f4f7 /web
parent16bbbc2abca7c2e5dc2e6876da0dba2bae9eed04 (diff)
parent02f8c18f40cd0e973e4c75b751e8fcbbbd019728 (diff)
downloadchat-f1a830ce9aea87fbeab7e54a6b2b56423e5fed45.tar.gz
chat-f1a830ce9aea87fbeab7e54a6b2b56423e5fed45.tar.bz2
chat-f1a830ce9aea87fbeab7e54a6b2b56423e5fed45.zip
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'web')
-rw-r--r--web/context.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/web/context.go b/web/context.go
index b1ab8a4a8..8f79421e5 100644
--- a/web/context.go
+++ b/web/context.go
@@ -49,10 +49,9 @@ func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
}
func (c *Context) LogError(err *model.AppError) {
-
// Filter out 404s, endless reconnects and browser compatibility errors
if err.StatusCode == http.StatusNotFound ||
- (c.Path == "/api/v3/users/websocket" && err.StatusCode == 401) ||
+ (c.Path == "/api/v3/users/websocket" && err.StatusCode == http.StatusUnauthorized) ||
err.Id == "web.check_browser_compatibility.app_error" {
c.LogDebug(err)
} else {
@@ -62,8 +61,13 @@ func (c *Context) LogError(err *model.AppError) {
}
func (c *Context) LogInfo(err *model.AppError) {
- mlog.Info(fmt.Sprintf("%v:%v code=%v rid=%v uid=%v ip=%v %v [details: %v]", c.Path, err.Where, err.StatusCode,
- c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError), mlog.String("user_id", c.Session.UserId))
+ // Filter out 401s
+ if err.StatusCode == http.StatusUnauthorized {
+ c.LogDebug(err)
+ } else {
+ mlog.Info(fmt.Sprintf("%v:%v code=%v rid=%v uid=%v ip=%v %v [details: %v]", c.Path, err.Where, err.StatusCode,
+ c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError), mlog.String("user_id", c.Session.UserId))
+ }
}
func (c *Context) LogDebug(err *model.AppError) {