cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.9.3.9 Log Observer events throwing 404 error

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');
    }
2 REPLIES 2

Re: Magento 1.9.3.9 Log Observer events throwing 404 error

This is happening to me too in 1.9.3.8.

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;
}