myDEBUG Backtrace for Zen Cart v1.5.0 through v1.5.4

Version 1.1.0

Current Support Thread at Zen Cart Forums: http://www.zen-cart.com/showthread.php?213695-myDEBUG-Backtrace-Support-Thread

What it does

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 the (not particularly helpful) log:

[04-Sep-2015 11: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):

[04-Sep-2015 11:19:22] Request URI: /testing/index.php?main_page=contact_us, IP address: 111.111.111.111
#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]


[04-Sep-2015 11: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

Starting with v1.1.0 of this plugin, the Request URI and IP address for the access are included in the log. There have been many times that an issue occurs only on a specific page and/or when a specific IP address makes the access.

Installation

This plugin's changes comprise two (2) core-file overwrites; you should always backup your cart's database and files prior to making any changes. Unzip the plugin's package file, rename the YOUR_ADMIN folder to match your custom admin folder's name and then copy the contents of that admin folder to your store's installation:

  1. /includes/extra_configures/enable_error_logging.php
  2. /YOUR_ADMIN/includes/extra_configures/enable_error_logging.php

Uninstall

Restore the two overwritten core files to the backup contents created during the plugin's installation.

Version History: