There was an example extension in one of my Magento U courses that I changed to fit a similar purpose. There may be some tweaking necessary, but the resulting module will give you the handle for any controller-actions and the url (that is the modification I made) in it's own log file, eventlog.log
. The code that I have looks like this:
app/etc/modules/Test_Loghooks.xml
<?xml version="1.0"?>
<config>
<modules>
<Test_Loghooks>
<active>true</active>
<codePool>local</codePool>
</Test_Loghooks>
</modules>
</config>
app/code/local/Test/Loghooks/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Test_Loghooks>
<version>0.1</version>
</Test_Loghooks>
</modules>
<global>
<models>
<Loghooks>
<class>Test_Loghooks_Model</class>
</Loghooks>
</models>
<events>
<controller_action_predispatch>
<observers>
<Loghooks>
<type>singleton</type>
<class>Loghooks/observer</class>
<method>controller_action_predispatch</method>
</Loghooks>
</observers>
</controller_action_predispatch>
</events>
</global>
</config>
app/code/local/Test/Loghooks/Model/Observer.php
<?php
class Test_Loghooks_Model_Observer {
public function controller_action_predispatch($observer) {
$_fullActionName = $observer->getEvent ()->getControllerAction ()->getFullActionName ();
Mage::log ( $_fullActionName.' | '.Mage::helper('core/url')->getCurrentUrl(),null, 'eventlog.log' );
}
}
?>