emmett-framework / granian

A Rust HTTP server for Python applications
BSD 3-Clause "New" or "Revised" License
2.61k stars 77 forks source link

Logs not displayed for webscoket connections #370

Closed durgeksh closed 1 week ago

durgeksh commented 1 month ago

Hi team, First of all thank you for the wonderful server. I am using Django + Channels for one web application. I want to use granian (granian==1.5.2) as server. Here, I do not see any logs for websocket requests.

My log config and command to run server is as below:

 granian --interface asgi myapp.asgi:application --access-log --access-log-fmt "%(time)s %(addr)s - %(method)s %(path)s %(protocol)s %(status)d %(dt_ms).3f %(query_string)s %(scheme)s"

Thank you

gi0baro commented 1 month ago

@durgeksh access log as of today only regards HTTP requests.

Now I see two different points here:

While the first point can be solved in the following release, I'm not sure how to tackle the latter one. Given the access log format is based on HTTP requests and not websockets (there are atoms there that simply won't make any sense in the context of a websocket message), what kind of information do you expect to see in logs? Maybe we can came up with a design for that.

durgeksh commented 1 month ago

@gi0baro Thank you so much for the reply. Have a great weekend ahead.