Re: Adding to Apache access log from PHP
| From: | Tom Rogers | Date: | Sun, 22 Dec 2002 02:01:10 +0000 |
| Subject: | Re: Adding to Apache access log from PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129087@lists.php.net to get a copy of this message | ||
Hi,
Wednesday, December 4, 2002, 12:13:22 AM, you wrote:
GC> Hi folks,
GC> I would like to add a few fields to a custom Apache access log format
GC> and populate the values from mod_php.
GC> As a mechanism, I was thinking of using the PHP function putenv( ) to
GC> set environmental variables. I am assuming that these would be in the
GC> same request namespace used by Apache?
GC> Then in Apache, I would use the mod_log_config directive documented
GC> as:
GC> "%...{FOOBAR}e: The contents of the environment variable FOOBAR"
GC> to place the value of the variables in the log string.
GC> Is this a sensible approach? I only have a live server to test on, so
GC> I'd like to be sure I am on the right track b
GC> --
GC> Geoff Caplan
GC> Advantae Ltd
GC> mailto:geoff@advantae.com
GC> http://www.advantae.com
You could use this
<?php apache_note('PHP_TITLE','Home Page')?>
Then the log formatter would be .....\"%{PHP_TITLE}n\"...
--
regards,
Tom