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.

4
  • there must be some action clearing session are you talking about admin placing orders in the backend? Oct 21, 2015 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? Oct 21, 2015 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. Oct 21, 2015 at 13:56
  • What is your session handler in your local.xml ? Also: magento.stackexchange.com/questions/428/…
    – B00MER
    Oct 21, 2015 at 17:11

1 Answer 1

1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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