johnbillion/query-monitor

Timings&Logs - No data logged

cpanti opened this issue · 8 comments

Nothing is logged under Timings or Logs.
do_action function is called with qm/debug, qm/start and qm/stop.
My error_log ($VH_ROOT/logs/$VH_NAME.error_log) doesn't show anything.

Anything else is working properly.

I don't know how to debug it.
Webserver: litespeed
Any idea where to start from?
Thank you,
Catalin

Are you sure the code path that contains those actions is running? For example, try putting some other debugging output immediately before it such as a var_dump( $value) followed by exit.

Absolutely @johnbillion.
I'm also using error_log to debug my code.
I also added some error_log commands in QM plugin (exemple class QM_Timer - Start) and I see them.

image
image

Does this code fire directly within the current page load or does it happen inside an Ajax request?

it is a Ajax call. I'm calling an wordpress plugin endpoint.
image

        jQuery.ajax({
            url: endPointOrigin+"/wp-admin/admin-ajax.php?action=SurveyJS_GetSurveyJson",
            type: "POST",
            data: {
                Id: mySurveyId,
                cf_token: token,
                href: window.location.href,
            },
            success: function(data) {

Timings and logs made in an AJAX call currently are not added to the QM panel.

Thank you John.
Two questions:

  1. you said currently. any plans to include it in the near future?
  2. what is in your opinion the best alternative for jQuery.ajax on Wordpress?

Actually I'm not the owner of the plugin, just help out.

I don't think it's on the roadmap for the near future, but it has been mentioned before.

There are a few approaches you can take to initiate an AJAX call, the most modern probably being fetch().

Debugging requests outside of the current page load is definitely the to-do list, but no ETA just yet.