On 09/21/2015 09:38 PM, Luc van Donkersgoed wrote: > I ran into this thread because I wanted to use mod_log_sql with > mod_rewrite. I ran into the exact problem described in this thread. > > I managed to fix it by patching libapache2-mod-log-sql and compiling it > myself. > > The adjustment is in > functions.h: > https://github.com/OutOfOrder/mod_log_sql/blob/1.100/functions.h#L91-L98 > > In this function, request_rec->status is used, but as described > in http://httpd.apache.org/docs/2.2/developer/API.html#log_handlers: > >>When a request has internally redirected, there is the question of what > to log. Apache handles this by bundling the entire chain of redirects > into a list of request_rec structures which are threaded through the > r->prev and r->next pointers. The request_rec which is passed to the > logging handlers in such cases is the one which was originally built for > the initial request from the client; note that the bytes_sent field will > only be correct in the last request in the chain (the one for which a > response was actually sent). > > This is the root cause of the problem. By checking if request_rec is not > null, and if that's the case, using the next request's status code, the > correct status codes are stored in the database. This solution works for > requests through mod_rewrite as well as requests which are not rewritten. > > Best, > Luc van Donkersgoed
Hi Luc, Would you be able to provide a patch for this? Cheers, Thomas Goirand (zigo)

