Error and troubleshooting in Magento



Magento provides very good error troubleshooting, but it is very important to know how to debug the errors by using the Magento troubleshooting methods. The Standard Error Page Just look like as the image below:

ErrorPage

As we can see in the above screenshot Magento did not display the error message directly due to the security reason, It stores the error files in the /var/report/ folder in Magento. This is a good, because you do not want outside people to know about your file name and paths.
But if you want to view the error message Navigate to /var/report/ folder in magento. Here you would see a file with the error number as the filename. Open it in any text editor to view the error message. If you want to display this error message on the frontend of your website you need to make changes to your configuration file. For this Navigate to the /errors/local.sample.xml and rename this file to /errors/local.xml. Now you would be able to view the error message in your web browser. Error Page like as the screenshot below:

ErrorPage2

1. Error Page Configuration In Magento

If you want to setup a nice error page with the email functionality, so that your customer can not view the default magento error page. For this Navigate to the /errors/local.xml file and change the

<action>print</action>
to
<action>email</action>

This will show a nice form on front end with the email functionality, From this user can email you back when they view the error message. If you want to change the styles of this page Navigate to the /errors/default/report.phtml file in Magento.

2. PHP Error Messages

Sometime, you will get the blank page on the frontend, So there might be some php error’s but by default all php error message are turned off in Magento. so that it is displaying the blank page and if you want to see the error, you must have to ON all the PHP errors, for this Open your index.php of Magento, located in based folder and changes are given below:

error_reporting(E_ALL | E_STRICT);
to
error_reporting(E_ALL);

and change

#ini_set('display_errors', 1);
to
ini_set('display_errors', 1);

3. Enable the Logging functionality in Magento

Magento logs functionality is another important aspect of troubleshooting. For enabling the error logs in Magento go to the Admin -> System -> Configuration –> Developer (Last section on Left navigation ) and after that there is a box for the Log Settings and make the Enabled “Yes”, Once logging is enabled, you will get error messages in /var/log folder. Refer the Screenshot below:

loggingOn

It is all about the debugging and troubleshooting error message which is provided by the Magento.

Enjoy the Maganto Coding, Thanks