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"?> <logging> <acme_productlabels translate="label"> <label>Acme Product Labels</label> <actions> <productlabels_productlabels_print> <action>save</action> <post_dispatch>postDispatchGeneric</post_dispatch> </productlabels_productlabels_print> <productlabels_productlabels_index> <action>view</action> <post_dispatch>postDispatchSimpleSave</post_dispatch> </productlabels_productlabels_index> </actions> </acme_productlabels> </logging>
This uses a custom route, so we added an observer in config.xml to accomplish this:
<config> <adminhtml> <events> <controller_action_postdispatch_productlabels> <observers> <enterprise_logging> <class>enterprise_logging/observer</class> <method>controllerPostdispatch</method> </enterprise_logging> </observers> </controller_action_postdispatch_productlabels> </events> </adminhtml> </config>
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?