Magento 2 Database Logging

Solved! How to Enable Magento 2 Database Logging

Sometimes you just need Magento’s database to tell all, and a very easy way to accomplish this is with the following:

Note: We know this works on Magento 2.3.0 using aMiSTACX, but we are not sure how far back it will work for Magento.

From CLI:

Enable

cd /var/www/magento

sudo bin/magento dev:query-log:enable
sudo php bin/magento cache:clean

Disable

sudo bin/magento dev:query-log:disable
sudo php bin/magento cache:clean

Note: logs will be found in magento/var/debug/db.log and they will be large so don’t leave this on!

Wow! That was very easy 😉

Comments are closed.