Motion - Feature Request 2011x 06x 21x 114336

Feature Request: additional HTTP logging


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

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
Topic attachments
I Attachment Action Size Date Who Comment
motion-3.2.12-loghttpd.01.patchpatch motion-3.2.12-loghttpd.01.patch manage 1 K 21 Jun 2011 - 12:24 MoritzBarsnick patch against motion-3.3.12 to provide enhanced HTTP logging
motion-trunk-r528-loghttpd.01.patchpatch motion-trunk-r528-loghttpd.01.patch manage 635 bytes 21 Jun 2011 - 12:25 MoritzBarsnick experimental patch against motion SVN trunk (r528) to provide enhanced HTTP logging (at least partly)
Topic revision: r3 - 21 May 2013, ZhuoLiu
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.