Used sqlquery to get the error log messages from watchdog table. Getting message like,

  1. 'Sending mail to: @to'.
  2. '%type: !message in %function (line %line of %file)' (which seems not relevant).

How can I get error log message similar as shown at SiteReports-->Recent Log Messages view?

1 Answer 1


The data is serialised and uses an array of named placeholders, so you'll need to use PHP to assemble the full message:

// Get data from the DB, each record stored in $row, then...
$message = $row->message;
$variables = unserialize($row->variables);

$full_message = strtr($message, $variables);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.