Monday 29 February 2016

Simple debugging with Magento (Using default and custom log files)


Several time developers need debugging to solve issues, in this post we will see how we can debug easily in Magento.

1) Default logs :  

If you want to check some data to confirm the values in it. You can simply use below code,

Mage::log("Check my data");

Now question is, where I can find the result of above code?

Simple: You can get the result at var/log/ folder and files will be,

 - exception.log
 - system.log

2) Custom log files creation:

Moving ahead you can also write your own custom logs for more advance debugging as below,

Use below statement,

Mage::log("Check your data", null, yourlogfile.log);

Now same question after declaration of above code where I can find the results?

Simple, you can find the result in directory var/log/

Now, I hope it will help you to debug your code or any Magento features. 




No comments:

Post a Comment