I am trying to log observer event names. So that in Mage.php file under Dispatch function written Mage::log function to log all the events name. But unfortunately, it's throwing 404 error.
Did confirm log is enabled despite it's not working.
What could be the issue? Did enabled display error but it's not showing anything. How can we identify the issue and log the observer events?
public static function dispatchEvent($name, array $data = array()) { Varien_Profiler::start('DISPATCH EVENT:'.$name); $result = self::app()->dispatchEvent($name, $data); Varien_Profiler::stop('DISPATCH EVENT:'.$name); Mage::log('My variable: '.$name); return $result; // Mage::log($name, null, 'events.log'); }
This is happening to me too in 1.9.3.8.
I haven't quite investigated why this happens but in order to log the output as it used to work before (when popping a simple Mage::log into the dispatchEvent function), you can add the below snippet instead of using the usual Mage::log:
$fName = Mage::getBaseDir() . '/var/log/events.log'; $fh = fopen($fName, 'a+'); fwrite($fh, $name . PHP_EOL); fclose($fh);
public static function dispatchEvent($name, array $data = array()) { $fName = Mage::getBaseDir() . '/var/log/events.log'; $fh = fopen($fName, 'a+'); fwrite($fh, $name . PHP_EOL); fclose($fh); Varien_Profiler::start('DISPATCH EVENT:'.$name); $result = self::app()->dispatchEvent($name, $data); Varien_Profiler::stop('DISPATCH EVENT:'.$name); return $result; }