Log context in case of websocket and socketio error
This commit is contained in:
parent
34e5599362
commit
c916d46763
@ -184,7 +184,7 @@ func (s *SocketIoServer) onMessage(c *gosocketio.Channel, req map[string]json.Ra
|
||||
s.metrics.SocketIORequests.With(common.Labels{"method": method, "status": "success"}).Inc()
|
||||
return rv
|
||||
}
|
||||
glog.Error(c.Id(), " onMessage ", method, ": ", errors.ErrorStack(err))
|
||||
glog.Error(c.Id(), " onMessage ", method, ": ", errors.ErrorStack(err), ", data ", string(params))
|
||||
s.metrics.SocketIORequests.With(common.Labels{"method": method, "status": "failure"}).Inc()
|
||||
e := resultError{}
|
||||
e.Error.Message = err.Error()
|
||||
|
||||
@ -340,7 +340,7 @@ func (s *WebsocketServer) onRequest(c *websocketChannel, req *websocketReq) {
|
||||
glog.V(1).Info("Client ", c.id, " onRequest ", req.Method, " success")
|
||||
s.metrics.WebsocketRequests.With(common.Labels{"method": req.Method, "status": "success"}).Inc()
|
||||
} else {
|
||||
glog.Error("Client ", c.id, " onMessage ", req.Method, ": ", errors.ErrorStack(err))
|
||||
glog.Error("Client ", c.id, " onMessage ", req.Method, ": ", errors.ErrorStack(err), ", data ", string(req.Params))
|
||||
s.metrics.WebsocketRequests.With(common.Labels{"method": req.Method, "status": "failure"}).Inc()
|
||||
e := resultError{}
|
||||
e.Error.Message = err.Error()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user