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

前端 未结 7 1368
南笙
南笙 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:17

    If you can get away with var_dump() an easy solution is:

    try {
       ...
    } catch (Exception $e)
       var_dump($e->getTrace());
    }
    

    Stolen from this great answer by Andre

提交回复
热议问题