httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Cardwell <apa...@blubbernet.com>
Subject Re: [users@httpd] Using env vars to compliment logging
Date Wed, 02 Aug 2006 18:36:30 GMT
* on the Wed, Aug 02, 2006 at 08:42:32AM +0200, Boyle Owen wrote:

> If I understood the OP correctly, he wants ever more fine-grained
> control than that - he wants separate logs for different ServerAliases
> *within* a VH... ("wildcard approach in a VirtualHost container").
>
> That can't be done and you'd have to define a separate VH for each alias
> (ie, expand the aliases into full VHs). As described in (1) above, the
> better approach is to parse a global logfile later - you can put the
> hostname into the LogFoprmat with %{Host}i.

The way I would tackle this is:

1.) Update the LogFormat to include %{Host}i as described above
2.) Log to a pipe instead of to a file
3.) Write a script that the log will be piped to which handles
    the logic of choosing a path depending on the host, and
    writes to the correct log file.

If you take this approach, be sure to secure it so a user can't for
example symlink a log file to a system file such as /etc/passwd causing
you to overwrite/corrupt it.

I'm available for contract work if this is out of your reach. There is
also http://jobs.perl.org/ which I have no affiliation to.

Mike

---------------------------------------------------------------------
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


Mime
View raw message