Thanks Brian, That totally worked

-----Original Message-----
From: Brian Rectanus [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 16, 2006 8:56 AM
To: users@httpd.apache.org
Subject: Re: [EMAIL PROTECTED] Log File Name

On 5/15/06, Michael Elias <[EMAIL PROTECTED]> wrote:
>
> I have a webfarm using a common httpd.conf for four machines connected
to a
> SAN. I would like to find a way to name the logfiles with the hostname
to
> identify what machine they came from.
>
> I tried passing a shell variable like below;
>
> CustomLog    "| /usr/sbin/rotatelogs /var/log/httpd/$HOSTNAME.%Y%m%d
86400"
> combined
>
> CustomLog    "| /usr/sbin/rotatelogs /var/log/httpd/%V.%Y%m%d 86400"
> combined
>
> but it didn't work,. I get the literal not the variable.

Consider cronolog http://freshmeat.net/projects/cronolog/

You may need a wrapper script to resolve the host.  Something like
this...

CustomLog "|/path/to/wrapper" combined


#!/bin/sh
# wrapper script
#
# Init and process any options here
#
exec /path/to/cronolog /var/log/httpd/`hostname`/%Y/%m/%d-access_log


-B

---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to