Logging SQL queries
• Magento2
Logging SQL queries in Magento2
In order to enable logging of sql queries in Magento2 you need to edit app/etc/di.xml
and
change the type for LoggerInterface
from Magento\Framework\DB\Logger\Quiet
to Magento\Framework\DB\Logger\File
.
Append this at the end of the file to pass required arguments:
Because I’m paranoid, I also executed a bin/magento cache:clean
afterwards and from now on all queries
should be logged into var/log/sql.log
.