httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brooks Sizemore <>
Subject Re: Capturing error text for output
Date Fri, 27 Mar 2009 16:42:45 GMT
On Wed, Mar 18, 2009 at 1:06 AM, Sorin Manolache <> wrote:

> However, I can imagine a super-complicated method to send _some_ of
> the log messages issued by apache before the response is sent. You
> pipe the log messages to an external application (see the syntax of
> the ErrorLog and CustomLog directives). Then, your external
> application behaves like a server and your module makes requests to
> the log server in order to retrieve the message logs. You'd have to
> use mod_unique_id and to log the unique ID of a request in order to be
> able to distinguish among log messages issued for different requests.
> I think it is not worth it because you can stumble in all kind of
> synchronisation or deadlock issues and anyway you won't have all the
> log messages, especially error messages that will not include the
> unique request ID.

Thanks for the reply, Sorin.

I've abandoned the idea that I will be able to capture error messages before
the response is sent back to the client. What I am toying with now is being
able to tie each message in the error log to a particular ID that can be
referenced in the access log. I would think this is a fairly common request,
but I am having trouble finding mention of it (maybe I'm just searching for
the wrong terms?).

It appears as though the error log format is completely inflexible, only
allowing customization in the actual log string that is logged to
log_error_core(). Can you think of a way to add a unique id (from
mod_unique_id or otherwise) globally to all lines logged in the error log
via a module? Logging unique_id in the log_transaction hook gets me part of
the way there, but there's no way of knowing how many other lines of error
text were logged before getting to the hook.

Certainly I could just add unique_id logging to log_error_core(), but I am
looking for a way that avoids recompilation of the server.

Brooks Sizemore

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message