tags:

views:

10

answers:

1

Dearest PHP folks, is there a way to make Xdebug show the entire stack on the screen but NOT write it to the error log? I'd only like the actual error line in the log file itself, but I'd like to see the stack on the screen.

A: 

Hi, xdebug uses the error handler mechanism to display its stack trace. If you checkout xdebug sources, and look in xdebug.c , you'll see this on line 801:

      if (XG(default_enable) && zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_SOAPACT     ION", 16, (void**)&dummy) == FAILURE) {
          zend_error_cb = new_error_cb;
          zend_throw_exception_hook = xdebug_throw_exception_hook;
      }

The xdebug_error_cb() (error callback) and xdebug_throw_execption_hook() functions are defined in another file, xdebug_stack.c , and do not seem to check any config settings to see whether the stack trace should be included in the log or not... so your only option is to rewrite these function in php, and set a new error handle with the set_error_handler() function. Good luck!

greg0ire