httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olaf Lautenschlaeger" <>
Subject Re: [users@httpd] custom log files and directories?
Date Thu, 22 Feb 2007 11:19:57 GMT
On Thursday, February 22, 2007 2:13 AM [GMT+1=CET],
William Kronert <> wrote:

> Hello,
> I want to direct the access logs from one directory to a custom log
> file.  Is this possible?  Example would be:
> I wish to have all the files that are accessed for
> put into a special access log file named:
> dirB-access_log and all the other access logs for all the other
> directories (minus dirB) put into the standard access_log (common)
> file.
> Is there away to do this?  I think it is possible using the custom
> log directive but I haven’t been able to get it to work.

You could try to place CustomLog directives within <Directory> con-
tainers, but I'm not sure if that will do (report here, if you've checked
it out).

Another method is proposed (similarly) in the Apache docs
(see /manual/mod/mod_log_config.html#customlog).

Tag your requests and write to different log files like so:

SetEnvIf Request_URI ^/dirA.* dirA_req
SetEnvIf Request_URI ^/dirB.* dirB_req
SetEnvIf Request_URI ^/(?!dir[AB]).* other_req
CustomLog dirA-access.log common env=dirA_req
CustomLog dirB-access.log common env=dirB_req
CustomLog access.log env=other_req


Olaf Lautenschlaeger
ANOVA Multimedia Studios GmbH

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message