You are here: Re: [PHP] logs problem « PHP « IT news, forums, messages
Re: [PHP] logs problem

Posted by Torgny Bjers on 08/12/05 11:52

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация