-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add request logging to worker #27
Comments
While @jondubois, is there an option to have this for socketcluster? We could use middlewares, but I think it would be rather useful to have it out of the box for debugging. |
@zalmoxisus you can control the log level in SC, but currently, it doesn't go as far as showing each individual request/response but yes it sounds reasonable to do that if the log level is high. |
@zalmoxisus After looking into I ended up adding For logging individual WebSocket events, I will see if there are existing npm modules which do that and if not, I might write one for SC - But I would like to keep this module optional (like So the idea is that right now SC handles the 'error logging' but the 'access logging' is the responsibility of the user. I'm happy to hear feedback though about all this. |
@jondubois, totally agree that logging HTTP (express) requests shouldn't be part of socketcluster, moreover that it's very simple to add. However, I'd like to see an example on how to log socket requests. |
@zalmoxisus Regarding WebSocket messages - I will write an optional add-on module for SC to make it easy. To decide whether or not to integrate this module as part of SC's core logging, I'll need to think about it a bit more (and get some feedback). The are a lot of ways to implement this type of 'access logging' (depending on the company and environment) so that's the argument for keeping it as a separate optional module (in userland). |
It would be a lot easier to pinpoint problems using remotedev-server if it logged requests. For example, if you send a request to a server and get a 502 response you'll want to know if the request ever made it to the server.
It would be sweet to pass logging options to remotedev-server that are then passed to the logging system so I can control the format and verbosity.
I've had good luck with morgan.
The text was updated successfully, but these errors were encountered: