Re: How to get trace of all database queries executed by php
| From: | Johannes Schlüter | Date: | Sun, 08 May 2016 17:51:33 +0000 |
| Subject: | Re: How to get trace of all database queries executed by php | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93116@lists.php.net to get a copy of this message | ||
Hi,
On Fri, 2016-05-06 at 19:34 -0400, Raja Kulasekaran wrote:
> Is there any php extension available which help me out to give the
> statistics of
> all the queries execution details ?
if you are on a development machine (thus no unrelated traffic)
something like a query log (in MySQL general_log) might be the quickest
and most simple way. However if you're using MySQL you might also look
at pecl.php.ne/mysqlnd_uh which allows to overload low level calls in
mysqlnd (thus below PDO or mysqli or so) from userland and adding your
own logging logic.
See http://php.net/manual/en/mysqlnd-uh.quickstart.query-monitoring.php
Maybe you should also check the license agreement of the software you're
using. Some people try to disallow that. (I can't tell whether such
rules might be relevant and binding)
johannes