6.x dblog.module dblog_watchdog($log = array())
7.x dblog.module dblog_watchdog(array $log_entry)

Implementation of hook_watchdog().

File

modules/dblog/dblog.module, line 131
System monitoring and logging for administrators.

Code

function dblog_watchdog($log = array()) {
  $current_db = db_set_active();
  db_query("INSERT INTO {watchdog}\n    (uid, type, message, variables, severity, link, location, referer, hostname, timestamp)\n    VALUES\n    (%d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $log['user']->uid, $log['type'], $log['message'], serialize($log['variables']), $log['severity'], $log['link'], $log['request_uri'], $log['referer'], $log['ip'], $log['timestamp']);
  if ($current_db) {
    db_set_active($current_db);
  }
}