Home » Blogs » Useful tips for Magento Debugging

Magento Debugging

Debugging is the process of identifying and removing number of bugs/errors from code. Development in Magento without debugging can be challenging for developer. As a development organization, oscprofessionals provides some useful information and tips about debugging for Magento users.

Debugging Magento is as follows:

Debugging Tips

  • 1.  Zend_Debug::debug() OR var_dump($data); OR print_r($data);
    There will be times that simply dumping data to the screen can be cause browser hangup. We always use the getData() method that Magento has built in to the varien object.

    • Reseting Password through the Database
    • Log Files: Magento Log system is very useful.
      How to turn on log system ?

      • In the goto Admin → System → Configuration → Developer
      • Select the Log Settings tab and select “Enabled = Yes”

magento_debugging
eg. How to used Mage::log($data,null,”data.log”);
You can specify your own log file, log file will appear in /var/log/data.log

  • 2. How to display PHP errors? How to turn them on?
    For development use only, do not do this on a production site.
    Change Mage::setIsDeveloperMode(true); in index.php
    ini_set(‘display_errors’, 1);
  • 3. Use of Eclipse debugger: Magento is installed on a desktop using Eclipse debugger. We apply breakpoints and other debugging tricks.
  • 4. Use of Varien Object getData, debug.
  • 5. Use of back trace:   Mage::log(Varien_Debug::backtrace(true, true), null, ‘backtrace.log’);
  • 6. Remote server level debugging.
  • 7.  var_dump PHP function to echo and exit.
  • 8. Use of Mage::log for error log and exception log. Also Magento report files.

Leave A Comment