Tell me more ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I am afraid that this might be a rhetorical question, but:

Is there any other and cleaner way to enable DB logging then modifying the file Varien/Db/Adapter/Pdo/Mysql.php and set $_debug and $_logAllQueries to true ?

share|improve this question

2 Answers

Just turn it on in my.cnf (usually in /etc/mysql at least it is on Ubuntu).

Use the following lines, restart mysql and it should be logging pretty much everything.

general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
share|improve this answer

You can copy the File to local/Varien/Db/Adapter/Pdy/Mysql.php and modify it there.

OR you could extend this class and set it in the local.xml

global/resources/default_setup/connection/type -> pdo_mysql_debug and then implement a Varien_Db_Adapter_Pdo_Mysql_Debug in local/Varien/Db/Adapter/Pdy/Mysql/Debug.php

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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