httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Wilson <and...@aaaaaaaa.demon.co.uk>
Subject Apache LogFormat - addition of %v virtual server ID (fwd)
Date Thu, 28 Mar 1996 06:41:13 GMT
Acked. Listeners to http-wg will have heard about this already.

Ay.

Forwarded message:
> From http-wg-request@cuckoo.hpl.hp.com Thu Mar 28 06:23:58 1996
> Resent-From: http-wg-request@cuckoo.hpl.hp.com
> Resent-Message-Id: <199603280623.GAA00179@aaaaaaaa.demon.co.uk>
> Old-Received: from skiddaw.elsevier.co.uk by thrall.cs.cf.ac.uk with SMTP (PP) 
>               id <03700-0@thrall.cs.cf.ac.uk>; Thu, 28 Mar 1996 03:47:52 +0000
> Old-Received: from snowdon.elsevier.co.uk (snowdon.elsevier.co.uk 
>               [193.131.197.164]) by skiddaw.elsevier.co.uk (8.6.13/8.6.12) 
>               with ESMTP id DAA08698 for <Andrew.Wilson@cs.cf.ac.uk>; Thu, 28 
>               Mar 1996 03:46:17 GMT
> Old-Received: from epprod.elsevier.co.uk (actually host epprod) by snowdon with 
>               SMTP (PP); Thu, 28 Mar 1996 03:36:59 +0000
> Old-Received: from hplb.hpl.hp.com (hplb.hpl.hp.com [15.255.59.2]) by 
>               epprod.elsevier.co.uk (8.6.13/8.6.12) with ESMTP id DAA01844 for 
>               <andrew@epprod.elsevier.co.uk>; Thu, 28 Mar 1996 03:32:53 GMT
> Old-Received: from cuckoo.hpl.hp.com by hplb.hpl.hp.com; Thu, 28 Mar 1996 
>               03:36:33 GMT
> Old-Received: by cuckoo.hpl.hp.com (1.37.109.16/15.6+ISC) id AA218364175; Thu, 
>               28 Mar 1996 03:36:15 GMT
> Old-Resent-Date: Thu, 28 Mar 1996 03:36:15 GMT
> Message-Id: <m0u28WT-001q3XC@tricord.rmi.net>
> Date: Wed, 27 Mar 96 20:37 MST
> From: andyr@rmi.net (Andy Rabagliati)
> To: http-wg%cuckoo.hpl.hp.com@hplb.hpl.hp.com
> X-Also-Posted-To: comp.infosystems.www.servers.unix
> Subject: Apache LogFormat - addition of %v virtual server ID
> X-Url: http://www.wizzy.com/andyr/
> Reply-To: andyr@wizzy.com (Andy Rabagliati)
> Organization: W.Z.I.
> Old-Resent-Message-Id: <"8k3iC.0.9L5.laWMn"@cuckoo>
> Old-Resent-From: http-wg@cuckoo.hpl.hp.com
> X-Mailing-List: <http-wg@cuckoo.hpl.hp.com> archive/latest/110
> X-Loop: http-wg@cuckoo.hpl.hp.com
> Precedence: list
> Old-Resent-Sender: http-wg-request@cuckoo.hpl.hp.com
> Resent-Date: Thu, 28 Mar 1996 03:49:47 +0000
> Resent-To: andrew@aaaaaaaa.demon.co.uk
> 
> Upgrading our server from httpd to Apache, I needed the %v addition
> mentioned in mod_log_config.c, and added this to apache.conf.
> 
> LogFormat "%h %l %u %t %v \"%r\" %s %b"
> 
> 
>  * The way this is supposed to work with virtual hosts is as follows:
>  * a virtual host can have its own LogFormat, or its own TransferLog.
>  * If it doesn't have its own LogFormat, it inherits from the main
>  * server.  If it doesn't have its own TransferLog, it writes to the
>  * same descriptor (meaning the same process for "| ...").
>  *
>  * That means that you can do things like:
>  *
>  * <VirtualHost hosta.com>
>  * LogFormat "hosta ..."
>  * ...
>  * </VirtualHost>
>  *
>  * <VirtualHost hosta.com>
>  * LogFormat "hostb ..."
>  * ...
>  * </VirtualHost>
>  *
>  * ... to have different virtual servers write into the same log file,
>  * but have some indication which host they came from, though a %v
>  * directive may well be a better way to handle this.
>  *
>  * --- rst
> 
> So, I hacked it in.
> 
> Here is the patch :-
> 
> *** apache_1.0.0/src/mod_log_config.c   Fri Mar  1 07:42:55 1996
> --- apache_1.0.3/src/mod_log_config.c   Wed Mar 27 19:50:49 1996
> ***************
> *** 159,164 ****
> --- 159,169 ----
>   
>   char *constant_item (request_rec *dummy, char *stuff) { return stuff; }
>   
> + /* added for %v functionality - andyr@wizzy.com */
> + 
> + char *log_server_hostname (request_rec *r, char *a)
> + { return r->server->server_hostname; }
> + 
>   char *log_remote_host (request_rec *r, char *a)
>   { return r->connection->remote_name; }
>   
> ***************
> *** 223,228 ****
> --- 228,234 ----
>       { 'l', log_remote_logname, 0 },
>       { 'u', log_remote_user, 0 },
>       { 't', log_request_time, 0 },
> +     { 'v', log_server_hostname, 0 },  /* added - andyr@wizzy.com */
>       { 'r', log_request_line, 1 },
>       { 's', log_status, 1 },
>       { 'b', log_bytes_sent, 0 },
> 
> Cheers,     Andy!
> 
> --
> -- Andy Rabagliati . andyr@wizzy.com
> --
> -- http://altavista.digital.com/cgi-bin/query?pg=q&q=Rabagliati
> 
> 


Mime
View raw message