#46355 [Opn->Bgs]: Query logger

From: Date: Wed, 22 Oct 2008 10:09:05 +0000
Subject: #46355 [Opn->Bgs]: Query logger
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129974@lists.php.net to get a copy of this message
 ID:               46355
 Updated by:       johannes@php.net
 Reported By:      olafvdspek at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: *
 PHP Version:      6CVS-2008-10-21 (CVS)
 New Comment:

You can use the MySQL Proxy or build an abstraction layer on top of the
mysql functions for doing that. 


Previous Comments:
------------------------------------------------------------------------

[2008-10-21 11:07:46] olafvdspek at gmail dot com

Description:
------------
Hi,

Could you add a (MySQL) query logger? It'd log each query, including
the duration and number of rows affected. This is very useful to
diagnose slow pages.

See below for an idea of what interface could be provided.

Reproduce code:
---------------
mysql_log_queries(true);
mysql_query("select * from T");
$a = mysql_get_log();
foreach ($a as $row)
{
    printf("%.1f ms - %d rows - %s", $row['duration'],
$row['affected_rows'], htmlspecialchars($row['query']));
}

Expected result:
----------------
-

Actual result:
--------------
-


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46355&edit=1



Thread (2 messages)

« previous php.bugs (#129974) next »