myDEBUG Backtrace [Support Thread]
This plugin builds on the suggestion I made to have the database's query_factory class include a debug_backtrace when a database interface error is detected, to aid in problem determination. There are other cases when a Zen Cart myDEBUG*.log file is created in which a "victim" (usually one of the Zen Cart built-in functions) is identified, but the "culprit" is actually the function's caller. This plugin updates the Zen Cart's built-in error handling (both admin- and store-side) to include a PHP debug_backtrace as part of the debug-log. That is, instead of receiving:
Code:
[19-Jun-2014 20:19:22] PHP Warning: strtr() [function.strtr]: The second argument is not an array in C:\xampp\htdocs\testing\includes\functions\functions_general.php on line 64
you'll receive the following log from which you can easily determine the "culprit" (/includes/init_includes/init_item.php):
Code:
[19-Jun-2014 20:19:22] #1 strtr() called at [C:\xampp\htdocs\testing\includes\functions\functions_general.php:64]
#2 zen_parse_input_field_data() called at [C:\xampp\htdocs\testing\includes\init_includes\init_item.php:8]
#3 require(C:\xampp\htdocs\testing\includes\init_includes\init_item.php) called at [C:\xampp\htdocs\testing\includes\autoload_func.php:48]
#4 require(C:\xampp\htdocs\testing\includes\autoload_func.php) called at [C:\xampp\htdocs\testing\includes\application_top.php:150]
#5 require(C:\xampp\htdocs\testing\includes\application_top.php) called at [C:\xampp\htdocs\testing\index.php:26]
[19-Jun-2014 20:19:22] PHP Warning: strtr() [function.strtr]: The second argument is not an array in C:\xampp\htdocs\testing\includes\functions\functions_general.php on line 64
I'll be submitting this to the Plugins area shortly and will post back the download link once I've received it!
Re: myDEBUG Backtrace [Support Thread]
Re: myDEBUG Backtrace [Support Thread]
Now available for download ...
Re: myDEBUG Backtrace [Support Thread]
Quick question to help identify how soon I should consider installing this (because I will regardless), I have been getting debug logs regarding duplicate cache entries for some time now, it started in 1.5.0 and while less frequent continues to appear in ZC 1.5.1. Is it likely that this additional debugging code would help identify where/why that is happening? I don't need to discuss the issue her that's for another threade, I'm just wondering about this plugin and if I should install it now to try to pinpoint the issue better by beginning some more history collection or if it is not likely to help for this one particular issue.
Re: myDEBUG Backtrace [Support Thread]
This plugin with help identify the cause of what I've termed "victim reports" in the debug log files, i.e. a debug-log file that reports an error in a class or function when the issue actually lies in the parameters supplied by the caller of the function.
Re: myDEBUG Backtrace [Support Thread]
I have installed this. Where can I see the logs ?
Re: myDEBUG Backtrace [Support Thread]
You'll only see the log-files (either in your /cache folder if you're running v1.5.0 or the /logs folder for v1.5.1+) if there's a PHP-related issue.
Re: myDEBUG Backtrace [Support Thread]
I am running 1.5.1.
I checked both the logs and cache folder. I do not see any entry there. I mean there are logs in logs folder, but not for today's or last week's date.
Am I doing the right thing? I have just taken backup and copied the files. And to reproduce the error, I clicked on the link which was giving error:
http://bambino.co.in/index.php?main_page=products_new
http://bambino.co.in/index.php?main_page=products_all
http://bambino.co.in/index.php?main_page=specials
... and so on
and then looked in the logs folder.
What should I do to solve this ?
Re: myDEBUG Backtrace [Support Thread]
Use your admin's Tools->Developers Tool Kit to search for select count(distinct *) as total in all Admin/Catalog files. What file(s) show as containing that code fragment?
Re: myDEBUG Backtrace [Support Thread]
I checked, there is no result for this match. I am searching in the last option (Look-up in all files) of the developer's tool kit & as advised by you, I am selecting both catalogue and admin files . Also I have selected both php and css.