You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Beaumont, Brett" <bb...@indcon.com> on 2003/02/26 16:04:50 UTC

[users@httpd] Conditional Logging for RedirectMatch directives

Hi,

I'm using a whole set of RedirectMatch directives in our Apache Web
Server (1.3.24) and I need to create a log message for each time that
a redirect was made.  While this information is available in the
access_log file, this file grows too large, too quickly to be of much
use to me.

Can anyone suggest a way to log only the redirects?  I found
information in the Apache docs that allows me to log based on
variables in the request, but what I really need is to log based on
the status of the response.

Thanks in advance,

Brett Beaumont

Programmer/Analyst
Indus Consultancy Services
(201) 261 3100 x235


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Conditional Logging for RedirectMatch directives

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 26 Feb 2003, Beaumont, Brett wrote:
> Can anyone suggest a way to log only the redirects?  I found
> information in the Apache docs that allows me to log based on
> variables in the request, but what I really need is to log based on
> the status of the response.

Not directly possible, unfortunately.

Suggestions:

1. Post-process your logs and just pick out the stuff you want (by looking
at the status code).  This is the simplest and most effecient thing to do.
If you need the info in real time, you can use a piped-logging process to
split out the info.

2. Match each RedirectMatch directive with a SetEnvIf Request_URI that
sets a particular env variable, and then make a conditional log based on
that env variable.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org