On 03.06.2010 16:49, Stefan Fritsch wrote:
On Tuesday 01 June 2010, Rainer Jung wrote:
4) General correlation improvements

To be able to correlate error and access log, it would be helpful
to share a common id, e.g. the unique_id, and be able to log it in
both files. The id generated by mod_unique_id comes too late
though (post_read_request). Since it actually only uses the
request timestamp and the connection id of the request, it could
be calculated much earlier.

I have thought about this before, but I wanted to get the per-module
loglevel configuration into trunk first.

The log id could be created by the first call to ap_log_rerror. If
there has not been an errorlog entry for a request by the time of the
log transaction hook, the corresponding field in the access log would
just be "-".

That's an interesting idea, making it pretty trivial to filter those lines, that have any error log entries.

The function creating the log id could also log some interesting
information once per request, instead of logging it for every log
line. For example PID/TID, local+remote IP+Port, number of keep-alives
on the connection, ...

Hmmm, but some basics should stay on each line, otherwise it's to much hassle collection stuff (or we provide a script). Being able to correlate between access and error log is nice, being forced to correlate inside the error log to collect the data is not so nice.

But I think a shorter id than the 20+ bytes of the unique id would be
sufficient in most cases, and cause less disk space usage. I guess it
would be good enough if the id is unique for one httpd instance in one
day.

Definitey.

Of course, if mod_unique_id is loaded, its long unique id could
be used.

+1

Do you already have any code fragments for that?

Rainer

Reply via email to