|
Patch Version: 1.0
Platform: osCommerce
Problem:
Your customers may run across PHP and/or MySQL errors while they are visiting your store. When this happens, it's very rare that they will accurately record the error messages, or even tell you about them.
Solution:
The "PHP/MySQL Error Logging Patch" is an osCommerce 2.2 add-on that will record the exact error message emitted by PHP. Furthermore, it will record the date, time and the name of the logged in user (when appropriate) at the time of the error.
Most importantly, traceback information is logged. This information tells you how the offending code came to be executed by telling you the file name and line number of the code that called the erroneous function, all the way up to the originating PHP script file. So instead of just knowing the SQL statement that failed, it tells you that index.php called application_top.php, which called tep_db_query(), and which line numbers each of those function calls appears on.
Viewing the log is done within the Admin Console. Configuration settings are available to name the file where the log data is to be placed, as well as turning on and off the logging of errors. An optional configuration setting is available to log every single SQL query made to the database into the same log file. This can be useful when trying to debug a problem, but it tends to fill up the log quickly.
If there are any entries in the log file, a message will appear at the top of the Admin Console page in the "Message Stack" alerting you to the log contents and providing a link to the log viewing page within the Console. On the viewing page is a button giving you the ability to delete the log contents and remove the message in the Message Stack. The contents of the log can be copied and pasted, allowing you to send them to your support personnel.
osCommerce does have a configuration setting called STORE_DB_TRANSACTIONS which logs all SQL queries. However, there is no method from within the Administration Console to modify the state of this variable and activate the logging -- it requires changing the code. Furthermore, the logging is done via the PHP error_log() function, which logs the error to the HTML Server's log file and requires the user to log in to their ISP's Control Panel to view it. We added the capability to log all SQL queries to the same log file as the PHP runtime errors so that it is easier to view the queries from within the existing osCommerce Admin Console.
This fix is compatible with PHP v4.0.2 and above and all versions of MySQL.
| Available Options: |
| Download: |
|
|