1

I have extended Mage_Cms_IndexController so that I can log my 404 pages. Within that class I have...

public function noRouteAction($coreRoute = null)
{
    $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
    $this->getResponse()->setHeader('Status','404 File not found');
    //Begin Modification
    Mage::log('My log data', null, '404s.log');
   //End modification
    $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_ROUTE_PAGE);
    if (!Mage::helper('cms/page')->renderPage($this, $pageId)) {
        $this->_forward('defaultNoRoute');
    }
}

System logs are enabled and /var as well as /var/log are chmod to 777.

1
  • 1
    Are you sure that your controller rewrite is enabled and it's class rewrites Mage_Cms_IndexController?
    – Dmytro
    Commented Jan 12, 2015 at 14:07

1 Answer 1

1

Have you tried forceLog = true?

Mage::log('My log data', null, '404s.log', true);
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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