Capturing Function Call Arguments

Sometimes it's helpful to see what arguments a function was called with, so you can replicate the issue and figure out the cause of the error. By default, Honeybadger will automatically include function arguments when rendering the backtrace on your dashboard. However, on some versions of PHP, you may need to enable this.

PHP 7.4 and later comes with the zend.exception_ignore_args setting in the php.ini file. This setting is designed to protect you from accidentally divulging sensitive information to the outside world. When this setting is set to “On”, function arguments won’t be included in traces.

If you expose your stack traces to outside users, you may want to keep this as “On”. However, if your traces are only sent to your logs and trusted services like Honeybadger, it’s typically safe to set this to “Off”. If you’d like Honeybadger to capture function arguments, you’ll need to set this to “Off”.

To do this:

  • Locate your ini file by running php --ini.
  • Open the ini file and change the value of zend.exception_ignore_args to “Off”

    ; Allows to include or exclude arguments from stack traces generated for exceptions
    ; Default: Off
    ; In production, it is recommended to turn this setting on to prohibit the output 
    ; of sensitive information in stack traces
    zend.exception_ignore_args = Off