How can I save a PHP backtrace to the error log?

前端 未结 6 2237
无人共我
无人共我 2021-01-31 02:34

I\'m using this right now:

error_log(serialize(debug_backtrace()));

But I have to unserialize it every time. Is there a better way to store bac

6条回答
  •  我在风中等你
    2021-01-31 03:21

    A little ugly but workable, I do this:

     error_log('Identifying string so that it doesn\'t just end up as gibberish' . json_encode(debug_backtrace()));
    

提交回复
热议问题