如何在zend框架中创建堆栈跟踪?

时间:2022-10-10 18:20:17

zend framework how to do a stack trace?
Stack trace:

zend框架如何做堆栈跟踪?堆栈跟踪:

# 0 C: \ apache \ www \ itransition \ library \ Zend \ Controller \ Front.php (954): Zend_Controller_Dispatcher_Standard-> dispatch (Object (Zend_Controller_Request_Http), Object (Zend_Controller_Response_Http))
# 1 C: \ apache \ www \ itransition \ library \ Zend \ Application \ Bootstrap \ Bootstrap.php (97): Zend_Controller_Front-> dispatch ()
# 2 C: \ apache \ www \ itransition \ library \ Zend \ Application.php (366): Zend_Application_Bootstrap_Bootstrap-> run ()
# 3 C: \ apache \ www \ itransition \ index.php (26): Zend_Application-> run ()
# 4 {main}

2 个解决方案

#1


4  

By catching a thrown exception, you can use Exception::getTraceAsString()

通过捕获抛出的异常,您可以使用Exception :: getTraceAsString()

try
{
    throw new Exception('Just testing...');
}
catch (Exception $e)
{
    echo $e->getTraceAsString();
}

#2


0  

see http://php.net/debug_backtrace

you also find many formatting examples in the comments

您还可以在评论中找到许多格式示例

#1


4  

By catching a thrown exception, you can use Exception::getTraceAsString()

通过捕获抛出的异常,您可以使用Exception :: getTraceAsString()

try
{
    throw new Exception('Just testing...');
}
catch (Exception $e)
{
    echo $e->getTraceAsString();
}

#2


0  

see http://php.net/debug_backtrace

you also find many formatting examples in the comments

您还可以在评论中找到许多格式示例