我有一个开发系统,display_errors打开,Magento处于开发人员模式,我试图
Mage::log($layered_navigation_filter_block); // Mage_Catalog_Block_Layer_Filter_Attribute
而且所有内容都被写入屏幕,而不是日志文件,为什么?
看起来像这种情况:
// app/Mage.php:837
if (is_array($message) || is_object($message)) {
$message = print_r($message, true);
}
但是print_r的第二个参数被忽略:
Mage_Catalog_Block_Layer_Filter_Category Object ( [_filter:protected] => ...
[28-Jan-2013 22:48:43 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 241434624 bytes) in /var/www/app/code/local/MyCompany/Motif/Model/Observer.php on line 47
[28-Jan-2013 22:48:43 UTC] PHP Stack trace:
[28-Jan-2013 22:48:43 UTC] PHP 1. {main}() /var/www/index.php:0
[28-Jan-2013 22:48:43 UTC] PHP 2. Mage::run() /var/www/index.php:87
[28-Jan-2013 22:48:43 UTC] PHP 3. Mage_Core_Model_App->run() /var/www/app/Mage.php:683
[28-Jan-2013 22:48:43 UTC] PHP 4. Mage_Core_Controller_Varien_Front->dispatch() /var/www/app/code/core/Mage/Core/Model/App.php:354
[28-Jan-2013 22:48:43 UTC] PHP 5. Mage_Core_Controller_Varien_Router_Standard->match() /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php:176
[28-Jan-2013 22:48:43 UTC] PHP 6. Mage_Core_Controller_Varien_Action->dispatch() /var/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:250
[28-Jan-2013 22:48:43 UTC] PHP 7. Mage_Catalog_CategoryController->viewAction() /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php:419
[28-Jan-2013 22:48:43 UTC] PHP 8. Mage_Core_Controller_Varien_Action->generateLayoutBlocks() /var/www/app/code/core/Mage/Catalog/controllers/CategoryController.php:146
[28-Jan-2013 22:48:43 UTC] PHP 9. Mage_Core_Model_Layout->generateBlocks() /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php:344
[28-Jan-2013 22:48:43 UTC] PHP 10. Mage_Core_Model_Layout->generateBlocks() /var/www/app/code/core/Mage/Core/Model/Layout.php:210
[28-Jan-2013 22:48:43 UTC] PHP 11. Mage_Core_Model_Layout->_generateBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:205
[28-Jan-2013 22:48:43 UTC] PHP 12. Mage_Core_Model_Layout->addBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:239
[28-Jan-2013 22:48:43 UTC] PHP 13. Mage_Core_Model_Layout->createBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:472
[28-Jan-2013 22:48:43 UTC] PHP 14. Mage_Core_Block_Abstract->setLayout() /var/www/app/code/core/Mage/Core/Model/Layout.php:456
[28-Jan-2013 22:48:43 UTC] PHP 15. Mage::dispatchEvent() /var/www/app/code/core/Mage/Core/Block/Abstract.php:239
[28-Jan-2013 22:48:43 UTC] PHP 16. Mage_Core_Model_App->dispatchEvent() /var/www/app/Mage.php:447
[28-Jan-2013 22:48:43 UTC] PHP 17. Mage_Core_Model_App->_callObserverMethod() /var/www/app/code/core/Mage/Core/Model/App.php:1317
[28-Jan-2013 22:48:43 UTC] PHP 18. MyCompany_Motif_Model_Observer->coreBlockAbstractPrepareLayoutAfter() /var/www/app/code/core/Mage/Core/Model/App.php:1338
[28-Jan-2013 22:48:43 UTC] PHP 19. print_r() /var/www/app/code/local/MyCompany/Motif/Model/Observer.php:47
好的,发生致命错误,没有注册shutdown_function,为什么回显print_r?:-)我还是不明白发生了什么。
屏幕上显示的输出是块对象转储还是异常?在调用Mage :: log之前,您可能正在捕获异常。
—
mybluevan 2013年
究竟是什么,写到屏幕上的是什么?
—
艾伦·斯托姆
更新了问题
—
Fabian Blechschmidt
您正在使用哪个Stack,Magento和/或PHP版本?
—
B00MER
MAMP PRO(Apache / 2.2.22,PHP 5.4.3)magento 1.7.0.2
—
Fabian Blechschmidt