Re: logs problem

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

 



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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux