diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-05-14 15:02:32 -0400 |
---|---|---|
committer | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-05-14 15:02:32 -0400 |
commit | f523a21e6d17ea6211155e94fbaafbb9a9858b79 (patch) | |
tree | 3d60246033ad9d3d52c322498d94fdcb232b9cca /api4 | |
parent | 527bf9d3d31e23679c65e0fcf9104c321e72f8c3 (diff) | |
download | chat-f523a21e6d17ea6211155e94fbaafbb9a9858b79.tar.gz chat-f523a21e6d17ea6211155e94fbaafbb9a9858b79.tar.bz2 chat-f523a21e6d17ea6211155e94fbaafbb9a9858b79.zip |
drop 401s from info to debug (#8778)
Diffstat (limited to 'api4')
-rw-r--r-- | api4/context.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/api4/context.go b/api4/context.go index c965e1d80..dbe0c889f 100644 --- a/api4/context.go +++ b/api4/context.go @@ -213,10 +213,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 { @@ -226,8 +225,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) { |