How can I get the full string of PHP’s getTraceAsString()?

前端 未结 7 1388
南笙
南笙 2020-12-08 10:32

I\'m using getTraceAsString() to get a stack trace but the string is being truncated for some reason.

Example, an exception is thrown and I log the stri

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 11:23

    You can print the backtrace with

    debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
    

    It does not truncate.

    Example print would be

    #0  W3\\Sausage\\Mushroom->setCredentials() called at [/sausage/common/library/W3/Vzaar/Api.php:40]
    #1  W3\\Sausage\\Mushroom->__construct() called at [/sausage/common/modules/video.mod.php:24]
    #2  ModVideo->__construct() called at [/sausage/common/core/modules.core.php:133]
    #3  Modules->__get() called at [/sausage/common/search/Classified/ESAdapter.php:399]
    #4  Base\\Search\\Classified\\ESAdapter->getVideoInfo() called at [/sausage/common/search/Classified/ESAdapter.php:436]
    #5  Base\\Search\\Classified\\ESAdapter->fillDataSet() called at [/sausage/common/search/Adapter.php:58]
    

提交回复
热议问题