Skip to main content

How to Enable Error logs - Magento 2

Updated over a week ago

This article explains how to enable and locate error logs in Magento 2.

⚠️ Always disable debug mode after troubleshooting is complete.

Prerequisites

  • Access to cPanel

  • Ensure PHP error logging is enabled in cPanel

  • Access to SSH

Completion of the task: 10 minutes

Expertise: advanced

Switch to Developer Mode

Connect via SSH and run

php bin/magento deploy:mode:set developer

Log File Locations

/path/to/your/magento2/var/log/exception.log /path/to/your/magento2/var/log/system.log

Enable Debug Logging

Connect via SSH and run

php bin/magento setup:config:set --enable-debug-logging=true

Disable Developer Mode

After troubleshooting, connect via SSH and run

php bin/magento deploy:mode:set production

Did this answer your question?