-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
webscoket request should be logged #280
Comments
Hi! That is very strange, as normally you should not see any logs from Morgan for websoxket requests, as websockets are not something that Express handles at all (and this is an Express middleware). Would you be able to provide example code that demonstrates what you are seeing? Please list of the versions of things you are using and include instructions for how to reproduce. |
Demo codeconst express = require('express'); const format=':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] B :total-time ms ":referrer" ":user-agent"'; app.use(morgan(format)); app.use(function (req, res, next) { app.listen(PORT, () => { Reproduce step: 2: Modify the line 133 on the morgan index.js file like [server] is listening on 3000 The solution that I am seeking that can return a status after server agree to upgrade this request to websocket. |
Currently, the web socket request have not been logged by default, but if set the immediate to true, it will be logged .
which makes the behavior are not consist, also, if look at the Chrome network, the web socket request is record with 101 status.
The text was updated successfully, but these errors were encountered: