|
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]
|