php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46355 Query logger
Submitted: 2008-10-21 11:07 UTC Modified: 2008-10-22 10:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: olafvdspek at gmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 6CVS-2008-10-21 (CVS) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: olafvdspek at gmail dot com
New email:
PHP Version: OS:

 

 [2008-10-21 11:07 UTC] 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:
--------------
-

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-22 10:09 UTC] johannes@php.net
You can use the MySQL Proxy or build an abstraction layer on top of the mysql functions for doing that. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 11:01:32 2024 UTC