johnbillion / query-monitor

The developer tools panel for WordPress
https://querymonitor.com
GNU General Public License v2.0
1.6k stars 212 forks source link

Can I track background processes? #173

Open hotnuts21 opened 8 years ago

hotnuts21 commented 8 years ago

Im currently using wpallimport which imports a large file, I think it essentially uses the wpcron option to chunk the file and iteratively import. however some of these imports fail with "ERROR: Could not insert post into the database". So the devs tell me to speak to the host and the host tells me theres no sql logs and so im trying to get to the bottom of what the issue is. Apparently that error is caused by mysql so there should be a record somewhere of an error message but even wp_debug doesnt show it.

So ive installed the plugin and its working but as the import happens in the background and not on page load, i dont seem to be picking up the mysql commands and replies. Is there someway in this plugin I can just say log everything sent to and from mysql from the site, so I can go back and look at this mysql activity log? Or is that not possible? If not, then feature request :-)

johnbillion commented 8 years ago

This is the number one most-requested feature of QM, and it's something that I've been actively working on for a while now. I've been performing restructuring in recent (and not so recent) versions of QM which will ultimately allow me to implement this.

There's no ETA just yet, but it's definitely on the cards in one form or another.

bobbingwide commented 8 years ago

At WordCamp Brighton on July @johnbillion asked me about the logic in my own plugin https://github.com/bobbingwide/oik-bwtrace which supports tracing of background requests.

All output is written to a plain text file on the server. You can enable tracing of saved queries.

xlearn-pty-ltd commented 5 years ago

Hi there - has there been any updates on this feature?

I'm also looking for logging, particularly around DB logging, where SQL queries are tracked. I don't use mySQL general query logging, because I need to relate the actual PHP function / file in order to diagnose exactly which call is running the SQL query.

Thanks! Brett

ivptr commented 2 years ago

It would be nice to be able to write output to a log file.

For example, saving the post takes ages and it is not possible to find the cause without logging to a file, because WP redirects the request at the end.