You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brandon Fosdick <bf...@bfoz.net> on 2007/01/13 06:24:05 UTC

mod_log_dbd and timestamps

I'm back to tinkering with mod_log_dbd again and I got to thinking about timestamps. The current logging behavior writes the output of apr_time_now() to the log, which naturally gives the time on the httpd server. But, the database server also has its own timestamp functionality. Is there any reason to favor one over the other? Any reason to do both?

Re: mod_log_dbd and timestamps

Posted by Brandon Fosdick <bf...@bfoz.net>.
Karl Southern wrote:
> Without wanting to steal anyone's thunder, is it not more relevant to
> have the time from the httpd perspective, as you're logging details
> about interacting with that set of processes? The SQL server could be
> running on a different box and have a different time, which could lead
> to debugging confusion (be it httpd or web-application related) if they
> have a [slightly] different time.

It is certainly arguable that having only one source of time is a Good Thing; at the very least you're guaranteed to not have discrepancies. However, the module is currently written such that each vhost could potentially log to a different database server. So, there's the potential for multiple vhosts on multiple servers logging to multiple database servers, which makes for a screwy web of time relationships. I'm not sure if using httpd time would be easier or harder to debug than database time. It probably depends on the exact server layout.

My thinking is that the module would be simpler if I just picked one. Another option is to use two time columns, one for database time and one for httpd time. That's reasonably simple, and could be helpful for diagnostics, but at the expense of extra storage and bandwidth. The most flexible option is to punt and let the admin decide, but it makes the module messy and the set of format specifiers is already rather overloaded. 

So I take the fourth option and plead for help :)


Re: mod_log_dbd and timestamps

Posted by Karl Southern <th...@blueyonder.co.uk>.
Brandon Fosdick wrote:
> I'm back to tinkering with mod_log_dbd again and I got to thinking about timestamps. The current logging behavior writes the output of apr_time_now() to the log, which naturally gives the time on the httpd server. But, the database server also has its own timestamp functionality. Is there any reason to favor one over the other? Any reason to do both?
>
>   
Without wanting to steal anyone's thunder, is it not more relevant to
have the time from the httpd perspective, as you're logging details
about interacting with that set of processes? The SQL server could be
running on a different box and have a different time, which could lead
to debugging confusion (be it httpd or web-application related) if they
have a [slightly] different time.

If I'm wildly wrong I'll ashamedly head back to lurking again :)