Is there a way that we can log all those actions used during an event in magento. Let say, while placing orders in onepage checkout, after placing order, there is one event fired at last 'sales_order_place_after', I wanted to trace all those actions being fired at and after this event. I am trying this because I am trying to debug an issue- After an order is placed in my magento site, admin user is getting logged out. My idea is saying that somewhere after order is placed, there must be some action clearing session, so I wanted to trace that action and check if its really clearing any session of there is some other root cause for the issue.
1 Answer
In the mainapp/code/core/Mage/Core/Model/App.php
class it shows how the observers of specific events being fired in the dispatchEvent
method , the foreach that starts on line ~1300 will loop through all of them after setting the event and the data passed.
foreach ($events[$eventName]['observers'] as $obsName=>$obs) {
$observer->setData(array('event'=>$event));
Varien_Profiler::start('OBSERVER: '.$obsName);
switch ($obs['type']) {
case 'disabled':
break;
case 'object':
case 'model':
$method = $obs['method'];
$observer->addData($args);
$object = Mage::getModel($obs['model']);
$this->_callObserverMethod($object, $method, $observer);
break;
default:
$method = $obs['method'];
$observer->addData($args);
$object = Mage::getSingleton($obs['model']);
$this->_callObserverMethod($object, $method, $observer);
break;
}
Varien_Profiler::stop('OBSERVER: '.$obsName);
}
So you will notice that the profiler starts to log those observers which if it is enabled , the output will be shown on the page you are working on.
http://www.techawaken.com/enable-magento-profiler-identify-magento-performance-bottlenecks/
Also you can log to your own file if you like :
http://magebase.com/magento-tutorials/create-your-own-log-files-with-magelog/
there must be some action clearing session
are you talking about admin placing orders in the backend?local.xml
? Also: magento.stackexchange.com/questions/428/…