Watchdog Backtrace

Public

Add a backtrace to watchdog messages

</> CopyGet raw version
php
  1. $backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS);
  2. $variables = array('@backtrace' => json_encode($backtrace, JSON_PRETTY_PRINT));
  3. watchdog('MODULE', 'Things happend, here\'s a backtrace:<br><pre>@backtrace</pre>', $variables, WATCHDOG_ERROR);