Would like to inflict a php error into some code so I can see all the processes that came before it. Do you have any recommendations for a simple error that would produce a warning but not take down the site?

Is there a better way to get a log of all of the processes that lead up to a specific event?

Comments

jun’s picture

Maybe what you want is to use trace_backtrace() ?

if (error condition) { trace_backtrace(); }

Should allow you to trigger the backtrace only when certain conditions are met.

Hope this is helpful.

Best,

Jun.