Trong Varien_Db_Adapter_Pdo_Mysql
Magento 1.4 : lib/varien/Db/Adapter/Pdo/Mysql.php
đặt
protected $_debug = true;
protected $_logAllQueries = true;
và (nếu cũng như chưa có) tạo thư mục được xác định trong
protected $_debugFile = 'var/debug/sql.txt';
Cấp quyền đọc / ghi