-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to using "go.uber.org/zap" for structured logging. #820
base: master
Are you sure you want to change the base?
Conversation
1b285a1
to
f953695
Compare
@@ -330,11 +332,15 @@ | |||
go c.processMessages() | |||
|
|||
addr := c.RemoteAddr() | |||
log := c.log.With( | |||
zap.String("addr", addr), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
@@ -448,11 +472,19 @@ | |||
return false | |||
} | |||
|
|||
log := c.log.With( | |||
zap.String("addr", c.RemoteAddr()), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
@@ -461,11 +493,18 @@ | |||
close: | |||
c.conn.SetWriteDeadline(time.Now().Add(writeWait)) // nolint | |||
if err := c.conn.WriteMessage(websocket.CloseMessage, closeData); err != nil { | |||
log := c.log.With( | |||
zap.String("addr", c.RemoteAddr()), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
@@ -536,11 +581,17 @@ | |||
msg := strconv.FormatInt(now, 10) | |||
c.conn.SetWriteDeadline(time.Now().Add(writeWait)) // nolint | |||
if err := c.conn.WriteMessage(websocket.PingMessage, []byte(msg)); err != nil { | |||
log := c.log.With( | |||
zap.String("addr", c.RemoteAddr()), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
@@ -856,7 +890,9 @@ | |||
|
|||
client, ok := c.(*Client) | |||
if !ok { | |||
log.Printf("Can't register non-client %T", c) | |||
h.log.Warn("Can't register non-client", | |||
zap.Any("client", c), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
if err != nil { | ||
log.Printf("Could not create client for %s: %s", addr, err) | ||
log.Error("Could not create client", | ||
zap.String("addr", addr), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
zap.Any("candidate", candidate), | ||
zap.Any("streamtype", client.StreamType()), | ||
zap.String("id", client.Id()), | ||
zap.Any("client", client), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
s.log.Warn("Received ice completed event from unknown client", | ||
zap.Any("streamtype", client.StreamType()), | ||
zap.String("id", client.Id()), | ||
zap.Any("client", client), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
log.Printf("Detected bruteforce attempt on \"%s\" from %s", action, client) | ||
t.log.Info("Detected bruteforce attempt", | ||
zap.String("action", action), | ||
zap.String("client", client), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
log.Printf("Failed attempt on \"%s\" from %s, throttling by %s", action, client, delay) | ||
t.log.Info("Failed attempt, throttling", | ||
zap.String("action", action), | ||
zap.String("client", client), |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by HTTP request headers
f953695
to
4771d5d
Compare
Pull Request Test Coverage Report for Build 10872977727Details
💛 - Coveralls |
No description provided.