var_dump()var_dump()
shows the information in your browser.
Mage::log()Mage::log()
echos information to your system.log file (var/log/system.logvar/log/system.log
).
To use Mage::log()Mage::log()
, you need to enable logging in the backend: System > Configuration > Developer -> Log Settings -> Enabled > Set to "Yes".
Furthermore you can force logging using the forth parameter of Mage::log()Mage::log()
set to true:
Mage::log($foo,null,'system.log',true);Mage::log($foo,null,'system.log',true);
According to the function in Mage.php:
public static function log($message, $level = null, $file = '', $forceLog = false)public static function log($message, $level = null, $file = '', $forceLog = false)
Mage::log()Mage::log()
will be especially useful if you do not see the output in your browser (debugging SOAP API requests, AJAX requests,...).