Skip to content

Instantly share code, notes, and snippets.

@dchatry
Created October 19, 2016 13:30
Show Gist options
  • Save dchatry/6462a8cb9694e072180df6d27d831601 to your computer and use it in GitHub Desktop.
Save dchatry/6462a8cb9694e072180df6d27d831601 to your computer and use it in GitHub Desktop.
[Drupal] Watchdog backtrace
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS);
$variables = array('@backtrace' => json_encode($backtrace, JSON_PRETTY_PRINT));
watchdog('MODULE', 'Things happend, here\'s a backtrace:<br><pre>@backtrace</pre>', $variables, WATCHDOG_ERROR);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment