RE: [PHP] Re: MySQL - PHP combined log
| From: | Dave | Date: | Wed, 24 Jul 2002 13:20:54 +0000 |
| Subject: | RE: [PHP] Re: MySQL - PHP combined log | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-109297@lists.php.net to get a copy of this message | ||
>><clipped>
>>>>how about this curve... getting PHP to append a line to the apache log.
>>>
>>>How about reading the documentation?
>>
>>Deserved that for not being clear enough... see below.
>
>My apologies if I missed the word "access log" or even assumed you meant
>"error log" when you just said "log." I shouldn't have.
RTFM never hurt anyone :)
>You're right, you can't do that, without opening up security more than you
>want to.
>
>*ACTUALLY*...
>
>There *probably* is an Apache function for access logs just like the error
>logging one that PHP is using, and you could *PROBABLY* patch PHP with some
>dead-easy copy&paste to use it, and you could even submit that worthy patch
>to the PHP Group. I suspect it's not there only because nobody really saw a
>need for it.
I've never had a use for it untill now, wanting to charge a customer for massive
uploads via file_upload forms... transfer that is not recorded in the apache
logs and therefor not collected for billable bandwidth (while still preserving
IP addresses and avoiding a ipfw counting per IP). Probably a requirement with
limited scope.
>It's kinda icky that you'd almost have to use 4 (the next unused number) for
>"Apache access log" with 0 being "Apache error log" and 1,2,3 being other
>stuff between... Maybe -1 for "access log"? Ewwwww. That's not
>'right'
>either, but maybe it's 'less wrong' than 4.
icky, I agree
>Damn things shouldn't have been magic numbers in the first place. Should be
>constants. Hey, while you're in there, make up some decent constant names
>and let's migrate to them and then deprecate the magic numbers and fix it
>right :-)
:)
>Another option might involve some sort of nasty named pipe stuff and
>redirection and whatnot, and you *MIGHT* be able to have a "file" that you
>error_log into, but it really just ends up going into the Apache log...
>There may be some risk of corrupting your access log, however, if any
>incredibly *HUGE* entry over-steps the atomicity threshold for file
>appending in Linux...
sounds like a nest of potential problems
>Not so sure it's a Good Idea anyway to have two programs trying to write to
>the same file at once if it can be avoided.
thus the interim solution of having PHP write to a seperate log file, then doing
a merge/sort during rotation time.
Will look into it to see if something can be presented without creating more
problems than the solution is worth.
Cheers,
Dave