HenningM / express-ws

WebSocket endpoints for express applications
BSD 2-Clause "Simplified" License
877 stars 142 forks source link

Any thoughts on how to log handlers globally? #43

Closed spacesuitdiver closed 7 years ago

spacesuitdiver commented 8 years ago

With regular express requests I'm using bunyan-middleware any thoughts on how to log ws handlers similarly?

roastduck commented 8 years ago

express-ws will emit GET request to a fake address when receiving each websocket request (when the connection starts). Can bunyan-middleware log those GET requests? I think they contain enough information about each websocket connection. If you need to log every time a socket receives, sends or emits an error, etc., this PR may help.

spacesuitdiver commented 8 years ago

@roastduck If it's creating a GET request similar to how express does it doesn't seem to log anything.

-- EDIT -- I guess I spoke too soon, I do get a log to /.websocket.

roastduck commented 8 years ago

@LeBlaaanc Does it meet your requirement? Maybe you can close this issue.