Enable Error Reporting in Magento 2

Magento 2 comes with 3 different modes. They are Default, Developer & Production. Each of the modes is tied to the stage your ecommerce store is in. After you’ve installed Magento 2, the store is in the “default” mode, which does not do error reporting. You need to enable the “developer” mode in Magento 2 to get error reporting working. You can do this as follows.
Log in to your terminal/ssh client and navigate to the root of your M2 installation. Then, execute the following command.

This will tell your M2 installation to switch to the developer mode and to enable developer help tools like error reporting. After you’re done developing, feel free to switch the mode back to production.

To check which mode your Magento 2 installation currently use, execute the following command in the SSH/command line tool.

Alternatively, if your M2 installation is already in developer mode, and you still can’t see error logs, you can try to add the following code to the index.php file.

you still can’t see error logs, you can try the below step

Go to pub/errors folder and rename local.xml.sample to local.xml .
Enable display_errors from app/bootstrap.php file line no. 11 (remove # from starting).

Share this article

Leave a comment