Re: logs problem
| From: | FSA | Date: | Fri, 12 Aug 2005 11:00:58 +0000 |
| Subject: | Re: logs problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220513@lists.php.net to get a copy of this message | ||
this is a local script with a medium amount of data to log i just
thaught it's a litle "barbarian" :) to actualy do inserts in the log
table for all queryes. That's why i thaught maibe there is a simple more
reliable way.
Torgny Bjers wrote:
> FSA wrote:
>
>>hi, i have a big php script with alot of db inserts and updates, what i
>>want to do it's to log all this db commands into a table. I was wonderig
>>if there is a better way to do this than the insert into logs_table the
>>actual queryes.
>>
>>ty
>
>
> Depending the amount of queries and the number of times the actual
> script is loaded, your logs could flood very easily and bog down the
> server. These notions of logging EVERYTHING is sometimes worse than
> actually allowing the culprit script to run slowly or execute lots of
> queries. 4 GB of logfile says way less than actually reading through the
> script and checking to make sure that the queries are proper. If you are
> still intent on logging these queries, I would go with your logs_table
> idea and limit the fields and field lengths to the extreme and index it
> tightly to make sure that it does not grow too much in size, that means,
> char or varchar, and definitely no text/blob fields.
>
> If this is a web script, one idea would be to only trigger the logging
> for a specific set of IP numbers, so that only your own browser triggers
> the logging, but it is left dormant while others browse.
>
> Regards,
> Torgny
>
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc