Skip to content

Instantly share code, notes, and snippets.

@Mihailoff
Created January 23, 2014 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mihailoff/8578367 to your computer and use it in GitHub Desktop.
Save Mihailoff/8578367 to your computer and use it in GitHub Desktop.
Include trace in Drupal watchdog messages
<?php
$e = new Exception();
watchdog(
'my_module',
"Message %foo !trace",
array(
'%foo' => 'Basic message',
'!trace' => nl2br("\n" . $e->getTraceAsString()),
),
WATCHDOG_DEBUG
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment