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 backtraces?
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 backtraces?
Then use the variable
$log
to log in file or what ever.From my perspective the best approach is using an exception functionality:
This should generate a readable string:
Additionally, debug_print_backtrace() prints the back trace as string and its output can be captured with regular output buffer functions:
A little ugly but workable, I do this: