Today I am going to start the series of the articles in Magento.No doubt Magento is a best open source e-commerce platform and whenever you are developing any site, code debugging is necessary and for that Magento provides options to enable system log and errors.
As we seen before about how to set Template Path Hint in Magento so today I am going to explain how you enable system log and errors/warning in Magento site.
Enable system log
First of all, let’s start with System Log.To Turn on error/system log, you need to follow below steps:
Steps
- Login to the Magento admin and Go to -> System -> Configuration
- In configuration, select “Developer” option which is on the bottom of the list.
- Select the Log Settings tab and set Enabled as Yes
It looks like below screen.you can view in below screen for understanding
NOTE: Default path for system log is /var/log/system.log.
Enable Error Display
Now, Let’s see to display PHP errors in Magento
You are working with Magento and you are not able to see PHP errors..ah sometimes it is frustrating.So let’s see the way to turn errors which you can display for development use only and don’t forget to disable it on a production site.
Open your root index.php and find out below if condition
1 2 3 4 5 | if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) { Mage::setIsDeveloperMode(true); } |
remove if condition and just display like below
1 2 3 | Mage::setIsDeveloperMode(true); |
and then remove # from below sentence to enable warning to display.
1 2 3 | ini_set(‘display_errors’, 1); |
Hope I could help someone and in today’s tutorial, you get an idea about how you debug your code in Magento.
NOTE: Don’t forget to disable both system log and errors/warning when you move the site to live.
As you can see, it’s very simple.I hope this little tutorial helps you with how to use browser detection built-in library into Joomla.Again if you have any questions just drop me a comment. So that’s all for now.
Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.