1

I have small problem. I have created my own module at local, I'd like to add logs for save/edit/delete actions with Enterprise Logging module.

I have created logging.xml at etc dir

app/code/local/AB/Characteristic/etc

<logging>
<characteristic translate="label">
    <label>Characteristics</label>
    <expected_models>
        <characteristic__characteristic />
    </expected_models>
    <actions>
        <characteristic_adminhtml_characteristic_save>
            <action>save</action>
        </characteristic_adminhtml_characteristic_save>
    </actions>
</characteristic></logging>

What I am doing wrong? Nothing save at /admin/logging/.

2

In my opinion you have some confusions to write logging.xml. See my sample and I explain:
config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Ssd_Faq>
            <active>true</active>
            <codePool>local</codePool>
            <version>1.1.3</version>
        </Ssd_Faq>
    </modules>

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules> <!--here admin router uses adminhtml route and <actions> node should has value adminhtml_faq_save -->
                        <Ssd_Faq before="Mage_Adminhtml">Ssd_Faq_Adminhtml</Ssd_Faq>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <!-- here if you use custom route for admin
    <admin>
    <routers>
        <some_module_node>
            <use>admin</use>
            <args>
                <module>Some_Module</module>
                <frontName>someroute</frontName>
            </args>
        </some_module_node>
    </routers>
    </admin> -->
    <!-- some nodes -->
    <global>
        <models>
            <ssd_faq> <!-- ssd_faq is my custom model name and <expected_models> node should has value ssd_faq__faq in logging.xml -->
                <class>Ssd_Faq_Model</class>
                <resourceModel>ssd_faq_mysql4</resourceModel>
            </ssd_faq>
            <!-- some nodes -->
        </models>
        <!-- some nodes -->
    </global>
</config>

logging.xml:

<?xml version="1.0"?>
<logging>
    <Ssd_Faq translate="label">
        <label>FAQ</label>
        <expected_models>
            <ssd_faq__faq/> <!--my model name is ssd_faq and I have Faq.php in Model folder-->
        </expected_models>
        <actions>
            <adminhtml_faq_save> <!--I use adminhtml route and I have FaqController.php in controllers/Admihtml folder-->
                <action>save</action>
            </adminhtml_faq_save>
            <someroute_somecontroller_save> <!--If you use custom route-->
                <action>save</action>
            </someroute_somecontroller_save>
            <!-- if you have some doubts where to find nodes like someroute_somecontroller_save or adminhtml_faq_save, open your controller and write this little debug code in particular action: echo $this->getFullActionName();die; You should write wull action name in the actions node. --> 
        </actions>
    </Ssd_Faq>
</logging>

And finally you should turn on your logging through admin->configuration->admin->admin actions logging and check [Characteristics] and save configuration

  • I have found solutions for custom routers, I have bug at config.xml, with custom route we have to declare action as: characteristicadmin_characteristic_save with characteristicadmin route. Now all working fine, thx @mageUz – Mateusz Lerczak Oct 8 '13 at 8:06
  • I updated the answer with custom route. – mageUz Oct 8 '13 at 8:58

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.