Get to debug_backtrace PHP backtrace functions ( debug_backtrace and debug_print_backtrace ) or, even better, a secure version of the Magento / large object, mageDebugBacktrace .
For example, I have an observer setting for the controller_action_predispatch event. If I put the following in my observer (since the observer can be called twice, you may not want to exit for your specific case)
class Pulsestorm_Requestset_Model_Observer { public function myMethod($observer) { mageDebugBacktrace(); exit; } }
and then load the page, I will get the following result when I try to load any page on the system (since this event fires on almost every page)
[1] /magento/app/code/core/Mage/Core/Model/App.php:1343 [2] /magento/app/code/core/Mage/Core/Model/App.php:1322 [3] /magento/app/Mage.php:455 [4] /magento/app/code/core/Mage/Core/Controller/Varien/Action.php:530 [5] /magento/app/code/core/Mage/Core/Controller/Front/Action.php:64 [6] /magento/app/code/core/Mage/Core/Controller/Varien/Action.php:408 [7] /magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:251 [8] /magento/app/code/core/Mage/Core/Controller/Varien/Front.php:176 [9] /magento/app/code/core/Mage/Core/Model/App.php:352 [10] /magento/app/Mage.php:691 [11] /magento/index.php:87
This gives me a simplified column to the point I called mageDebugBacktrace . [#] is just the ordering of the list, followed by the line : delimited. The left side of the line ( /magento/app/code/core/Mage/Core/Model/App.php ) is a PHP file, the right side of the line ( 1343 ) is the number of the line where the method was called .
First three calls
[1] /magento/app/code/core/Mage/Core/Model/App.php:1343 [2] /magento/app/code/core/Mage/Core/Model/App.php:1322 [3] /magento/app/Mage.php:455
is the PHP code that sent this event. For example, line 455 Mage.php on my system
$result = self::app()->dispatchEvent($name, $data);
This (usually depending on the version of Magento / state of your kernel) is the fourth call on the stack that will indicate where the event was sent.
[4] /magento/app/code/core/Mage/Core/Controller/Varien/Action.php:530
line 530 of Action.php on my system
Mage::dispatchEvent('controller_action_predispatch', array('controller_action' => $this));
Bingo! Mage::dispatchEvent is the code that dispatches the event, so we found our dispatch point.
As already mentioned, your observer can be called several times - therefore, data logging with output buffering may be better than the output / output used above
ob_start(); mageDebugBacktrace(); $contents = ob_get_clean(); Mage::Log($contents);