Raygun Feature Request

Feature Request

Php stacktrace

Current Status:

Will not add

Votes:

9


Avatar

it-ony

I played around with the php client for raygun. The stacktrace for register_shutdown_function is the stacktrace from the shutdown function to the raygun sending of the error instead of the stacktrace that caused that error.

There is the possibility to get the original stack trace with the debug_stacktrace() function. See http://www.php.net/manual/de/function.debug-backtrace.php


Avatar

Callum

Posted on
May 06 2014

Unfortunately by the time the function provided to registershutdownfunction has been called all your functions have returned or have been cleared from the stack, thus debug_backtrace has no effect. This is detailed here: http://stackoverflow.com/questions/7241834/debug-backtrace-from-registered-shutdown-function-in-php and here: http://www.php.net/manual/en/function.register-shutdown-function.php#95256

You could use errorgetlast and then send that error using RaygunClient.send(), but this will have less than ideal automatic grouping due to it missing the required file/class/function data in an array of stack trace frames. This may be useful if you must get the shutdown error, but as getting a back trace is not possible in PHP from registershutdownfunction we'll have to close this for now - sorry we can't be of assistance here.