[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

VS: Apache 2.x remote logging



I found somewhere a perl script that does the logging separation. 

Add to the httpd.conf
--- clip ---
    LogFormat "%V|%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-agent}i\""
    TransferLog |/usr/sbin/logger
--- clap ---

Add this script to the /usr/sbin/logger -file 

--- clip ---
#!/usr/bin/perl -w

while($input = <STDIN>) {

    # Split string
    ($filename,$log_string) = split(/\|/,$input);

    # Output to file
    $file = "/home/www/logs/access_".$filename.".log";

    open(FILE_OUT,"+>>$file");
    print FILE_OUT $log_string;
    close(FILE_OUT);
}
--- clap ---

And now you will get all the virtual domain access logs to the separate
/home/www/logs/access_<domain name>.log -files

Best regards,

  Tommi Pisto  


-----Alkuperäinen viesti-----
Lähettäjä: Christian Hammers [mailto:ch@debian.org] 
Lähetetty: 31. toukokuuta 2005 16:00
Vastaanottaja: Fredrik Steen
Kopio: debian-isp@lists.debian.org
Aihe: Re: Apache 2.x remote logging

Hello

On 2005-05-31 Fredrik Steen wrote:
> I'm in the process of building a web farm consisting of 10-20-30 
> something web servers handling 300k of virtual hosts and have started 
> to look at how to handle logging for these hosts.

Don't know if it's performant enough but you could just use a script like
logger to do remote syslogging:
    CustomLog "| /usr/bin/logger -p local7.info -t www.example.com" ...

bye,

-christian-


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org




Reply to: