by Chemo
This contribution modifes the stock osCommerce code for logging queries. Currently, the stock method is virtually useless. It will log every query and create a log file that may contain the data that you want but will have to get past the 99% of other stuff you don't.
Once installed you can select which queries to log based on the execution time. For instance, you can use "5" and all queries that take longer than 5 seconds will be logged to file. All those that take 4.9999 seconds and less will not be logged. This will help you zero in on those problem queries and fix them faster.
STEP 1 - Edit *catalog*/includes/functions/database.php
Find the function tep_db_query()
REPLACE WITH THIS CODE:
STEP 2 - Edit *admin*/includes/functions/database.php
Do the same thing to this file. Replace tep_db_query() with the code above.
STEP 3 - Admin Control Panel -> Configuration -> Logging
Log Destination -> Make sure this is your FULL FILESYSTEM path and includes the filenameFor example: /home/username/public_html/log/queries_debug.txt
I would recommend putting this file in your document root so you can inspect it as needed from any web browser. Most will display the contentst in the browser window but even a download will give instant access to the info without having to FTP the file.
Store Database Queries -> TrueThis will enable the logging of the queries.
The installation is pretty straight forward. The target audience for this contribution are coders, developers, and advanced webmasters that want to log only selective queries based on executing time. Thus, if you are clueless and can't figure it out and/or correct the install problem please email: blackhole@mesoimpact.com
osCommerce is a community driven organization and as such the support base will fall entirely on the [coder and developer] forum members. The code is thoroughly commented and should be easy to follow for any coder. I offer limited support in-between paid projects (feeding my family comes first before volunteer time).
If you use this contribution and find it useful a small donation can be made via PayPal. If you're a coder, designer, or webmaster and would like to contract me for site analysis or custom coding please email me with the link at the top of this page. Thank you for your support!
This contribution is hack of the stock osC code. Credit goes to them for having the idea of logging the queries but my credit for modifying it so the data is useful. Enjoy!
eCommerce-Directory.orgIf you're interested in SEO for your store be sure to submit your site to my directory! It has a high PR and clean links |
Blatant Footer AdvertisementIf you need reliable, extremely fast, and expert webhosting for your store I am opening my server to accounts. Each account gets unlimited everything and trust my server is setup to run osCommerce at top speed. |