我找不到任何关于如何在 Magento 中读取 exception.log
的文档;有关如何阅读此内容的文档在哪里?
如果没有文档,异常打印的顺序是什么?
#0 是最后发生还是最先发生?
Stack trace:
#0 .../html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 .../html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 .../html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 .../html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('select eav_opti...', Array)
#4 .../html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('select eav_opti...', Array)
#5 .../html/app/code/local/FME/Manufacturers/Model/Observer/Product.php(47): Varien_Db_Adapter_Pdo_Mysql->query('select eav_opti...')
#6 .../html/app/code/core/Mage/Core/Model/App.php(1338): FME_Manufacturers_Model_Observer_Product->saveTabData(Object(Varien_Event_Observer))
#7 .../html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(FME_Manufacturers_Model_Observer_Product), 'saveTabData', Object(Varien_Event_Observer))
#8 .../html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#9 .../html/app/code/core/Mage/Core/Model/Abstract.php(466): Mage::dispatchEvent('catalog_product...', Array)
#10 .../html/app/code/core/Mage/Catalog/Model/Product.php(548): Mage_Core_Model_Abstract->_afterSave()
#11 .../html/app/code/core/Mage/Core/Model/Abstract.php(319): Mage_Catalog_Model_Product->_afterSave()
#12 .../html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(714): Mage_Core_Model_Abstract->save()
#13 .../html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Catalog_ProductController->saveAction()
#14 .../html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#15 .../html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 .../html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#17 .../html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#18 .../html/index.php(91): Mage::run('', 'store')
#19 {main}
最佳答案
这是一个常规的 PHP 异常堆栈跟踪;它不是特定于 Magento。
第 0 行告诉我们,lib/Varien/Db/Statement/Pdo/Mysql.php
文件的 110
行成功调用了方法 Zend_Db_Statement_Pdo->_execute()
,但随后执行此方法的命令之一导致抛出 Exception
.
简单地说,堆栈跟踪只是方法/函数调用的列表,当抛出异常时,应用程序正处于执行过程中。
代码执行开始于 #19 {main}
(堆栈底部)。
- #18,
{main}
一直执行到Mage::run()
方法被调用91
index.php
- #17,
Mage::run()
一直执行到
方法Mage_Core_Model_App->run()
被调用app/Mage.php
683 - :
- #1,
Zend_Db_Statement->execute()
一直执行到
方法Varien_Db_Statement_Pdo_Mysql->_execute()
被调用lib/Zend/Db/Statement.php
300 - #0,
Varien_Db_Statement_Pdo_Mysql->_execute()
一直执行到
方法Zend_Db_Statement_Pdo->_execute()
被调用lib/Varien/Db/Statement/Pdo/Mysql.php
的 >110
但此方法的某些命令导致抛出异常。
作为旁注,我通常不会说堆栈跟踪是“沿着失败的函数列表向下”,就像@pzirkind 在他的回答中提到的那样。
因为如果在 #0(堆栈顶部)中调用的方法不会“失败”,那么之前调用的许多方法可能仍然按预期工作(而且许多通常做,至少根据我的经验),甚至捕获
抛出的异常。
关于php - 在 Magento 中,如何读取 exception.log?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11958163/