Skip to content

Instantly share code, notes, and snippets.

@mehdichaouch
Created May 12, 2017 14:56
Show Gist options
  • Save mehdichaouch/0f88d14af9a85dd77ceb12ba46ee0b1f to your computer and use it in GitHub Desktop.
Save mehdichaouch/0f88d14af9a85dd77ceb12ba46ee0b1f to your computer and use it in GitHub Desktop.
Magento - Log all events on action
<?php
# change method in mage.php
public static function dispatchEvent($name, array $data = array())
{
Mage::log('Event: ' . $name); //not using Mage::log, as
//file_put_contents('/tmp/test.log','Dispatching '. $name. "\n",FILE_APPEND); //poor man's log
Varien_Profiler::start('DISPATCH EVENT:'.$name);
$result = self::app()->dispatchEvent($name, $data);
#$result = self::registry('events')->dispatch($name, $data);
Varien_Profiler::stop('DISPATCH EVENT:'.$name);
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment