We've created a module for Enterprise that has 2 controller actions, one is the index and the other is a save from a massaction. We're logging to the Admin Actions Log with the following logging.xml:

<?xml version="1.0" encoding="UTF-8"?>
    <acme_productlabels translate="label">
        <label>Acme Product Labels</label>

This uses a custom route, so we added an observer in config.xml to accomplish this:


This works fine for the index, but for the save action, it fails. When we use postDispatchSimpleSave for the save action, it logs the action but without the full details.

We need the save action, when logged, to also include the parameters that were submitted to the save action. Currently that includes a selection of products, a quantity, and a boolean value, submitted as a massaction in a grid.

So our basic question is, how do we log the full details of a save action in Magento's admin action log?


I spent many hours debugging and exploring Enterprise_Logging module and found that when admin mass updates product attributes, selected product ids are not being fetched correctly. But this module has functionality to save product ids while mass updating. See /app/code/core/Enterprise/Logging/Model/Handler/Controllers.php model and its function:

public function postDispatchProductUpdateAttributes($config, $eventModel, $processor)
        $request = Mage::app()->getRequest();
        $change = Mage::getModel('enterprise_logging/event_changes');
        $products = $request->getParam('product');//here is incorrect values are coming
        if (!$products) {
            $products = Mage::helper('adminhtml/catalog_product_edit_action_attribute')->getProductIds();
        if ($products) {
            $processor->addEventChanges(clone $change->setSourceName('product')
                ->setResultData(array('ids' => implode(', ', $products))));


by the way $products = $request->getParam('product') expression should get product ids properly but, it is not correct and you should set "product" param as false and next lines

if (!$products) {
     $products = Mage::helper('adminhtml/catalog_product_edit_action_attribute')->getProductIds();

will be fetched product ids properly. See my solution: /app/code/local/Some/Module/etc/config.xml:



class Some_Module_Model_Observer
    function fixProductIds()
        //set product param as false
        Mage::app()->getRequest()->setParam('product', false);

This solution gives me perfect result.

  • In our case we're trying to log actions on a custom module we've created. How would we capture the POST data submitted by the grid, and log it in admin logging? Would we need to write our own postDispatch method? – user3336 Sep 26 '13 at 0:45
  • Yes of course, I will add new answer – mageUz Sep 26 '13 at 5:14
  • See this answer magento.stackexchange.com/questions/9030/… – mageUz Oct 8 '13 at 8:51

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