Database Query Logger

Database Query Logger
This VQMOD logs all database queries and the amount of time it took to execute each query to a file. This is helpful to identify queries that aren't being as efficient as they could be (notably, I have seen many extensions and VQMODS that don't take a good approach to indexing their data - using this VQMOD could help identify bottlenecks so that you can correct them later).

How it works:
This mod intercepts all calls the the $db->adaptor->query() method, and starts a timer before the query executes and ends the timer at the end of the execution. It should therefore work regardless of the database the site uses.

It logs each query to a text file in your sites logs directory, (typically /system/storage/logs/database.log).

Words of warning
1 - It's highly advisable you not run this on a production server, as it does impose a bit of overhead to the process. Much better to set up a dev server with a copy of your current database and work from there.

2 - As all queries are written to a file, if that file gets exposed to the world, sensitive information can be revealed to the world. Following the official recommendation of moving the system directory outside of the public HTML directory is the best solution here.




Download
  • Developed by OpenCart Community
  • 12 Months Free Support
  • Documentation Included

Rating

Compatibility
3.0.0.0, 3.0.1.1, 3.0.1.2, 3.0.2.0, 3.1.0.0alpha, 2.2.0.0, 2.3.0.0, 2.3.0.1, 2.3.0.2

Last Update
14 Feb 2018

Created
16 May 2017
124 Downloads
1 Comments
lucasdv
lucasdv
Member since: 23 Dec 2016

View all extensions Get Support