wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Log websocket connection attempts in nginx access.log #176

Closed mkonecny closed 9 years ago

mkonecny commented 9 years ago

ATM, I don't see these connection attempts logged anywhere.

Is there a reason not to log these? I know that the Content-Length field would be impossible to determine at log time, but perhaps this could simply be a fake value (0 bytes, -1 bytes)?

wandenberg commented 9 years ago

@mkonecny the access.log is written only when the request is finished. This is done by Nginx core, the module does not interferes on this process.

mkonecny commented 9 years ago

Would it be a violation to write to this log when the WebSocket request handshake is successfully upgraded from HTTP?

I'm thinking this would be useful since currently there is little visibility into unsuccessful connection attempts.

wandenberg commented 9 years ago

there is no function to write on access log. I guess that will be a violation. In any case, if the connection fail it will be written immediately. So if there is nothing on your log is because the connection was done successfully :)