0

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.

  • there must be some action clearing session are you talking about admin placing orders in the backend? – Julien Lachal Oct 21 '15 at 13:38
  • @JulienLachal: No, normal customers are placing orders in frontend but somehow admin is getting logged out after every orders are placed..Perhaps, It has started after a third party upgraded the site from 18 to 1.9..any possible solutions? – Anurag Khandelwal Oct 21 '15 at 13:51
  • "It has started after a third party upgraded the site from 1.8 to 1.9" are you talking about someone upgrading your Magento? Or about a specific module? If it's a someone, I suggest you ask them what they have done. – Julien Lachal Oct 21 '15 at 13:56
  • What is your session handler in your local.xml ? Also: magento.stackexchange.com/questions/428/… – B00MER Oct 21 '15 at 17:11
0

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.