how to setup mysql logging from php scripts
| From: | Petre Agenbag | Date: | Thu, 17 Oct 2002 06:31:23 +0000 |
| Subject: | how to setup mysql logging from php scripts | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120289@lists.php.net to get a copy of this message | ||
Hi
I need to be able to see logs of all mysql queries from php scripts on
my server.
I have a multitude of virtual hosts on my RedHat server, with many mysql
db's, and would like to be able to see what queries are done against the
db's from which scripts. The reason being is that I suspect that some of
the scripts on some domains are causing problems, for example infinite
loop db queries etc. Yesterday again I had mysql freeze up completely on
the server, and the only "interaction" with mysql are from php scripts
on the various domains, so looking at the mysql.log file gives no help.
Ideally I would like to see something like the following logged:
time || path/to/script.php || sql_query || mysql_error
or ANYthing that will help me to determine what went wrong.
At the moment I can merely blame the gremlins, and I don't know if it is
a poorly written script causing this or not, so I can't do anything
about the situation...
ANY suggestions or methods being used by ppl out there are also welcome.
Thanks alot.