Feature Request: additional HTTP logging
Description
Hi, when I started using motion's built-in web server for streaming (via the excellent nph-mjprox CGI program from MJPEG-ProxyGrab), I had the desire to add a small amount of HTTP logging to motion's log messages.
I realize that the CGI nph-mjprox will make all connects appear as coming from localhost, but perhaps it's even more useful for those who connect directly to motion's HTTP server.
I have a working patch for 3.2.11 which also works for 3.2.12. The result looks like this:
2011-06-21T09:33:34.340667+02:00 myhost motion: [1] Bound to port 8091 for HTTP (loopback interface only)
2011-06-21T09:33:34.340717+02:00 myhost motion: [1] Listening on port 8091
2011-06-21T09:33:34.340771+02:00 myhost motion: [1] Resizing pre_capture buffer to 3 items
2011-06-21T14:11:25.378549+02:00 myhost motion: [1] Accepted HTTP connection from 127.0.0.1
What doesn't work:
- I couldn't figure out which code gets called when the streaming client (i.e. the receiving web browser or program) interrupts the stream, so there is no log message for a closed stream;
- my inet_ntoa() usage probably doesn't apply to IPv6 (as implemented on motion trunk);
- motion trunk has added some logging facilities to this code (stream.c), and has changed its logging mechanics, so I probably haven't successfully adapted to that code. I would like to see this as a feature. Two patches are attached.
--
MoritzBarsnick - 21 Jun 2011
Follow up
this is what I've been thinking that is useful for my recent needs. it also would be very helpful to get a detailed log that can be switched on and off logging which kind of operation along with the parameters has been performed from the web browser.
--
ZhuoLiu - 21 May 2013