I want to log all the query that affect only specific table. For example catalog_product_flat_1. So if query makes update, delete or insert operation to this table it should be logged. It cаused by deleting column sku from time to time from this table and I want to find out the reason.

1 Answer 1


Enable logging by

  1. setting Varien_Db_Adapter_Pdo_Mysql::_logAllQueries to true
  2. setting \Varien_Db_Adapter_Pdo_Mysql::$_debug to true

Then grep in the file var/debug/pdo_mysql.log for the table name. You can also add code to Varien_Db_Adapter_Pdo_Mysql::_debugStat which filters for the table name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.