- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018
02:33 AM
07-27-2018
02:33 AM
Magento 1.9.3.9 Log Observer events throwing 404 error
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'); }
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2018
09:54 AM
11-16-2018
09:54 AM
Re: Magento 1.9.3.9 Log Observer events throwing 404 error
This is happening to me too in 1.9.3.8.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019
02:38 AM
07-15-2019
02:38 AM
Re: Magento 1.9.3.9 Log Observer events throwing 404 error
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; }