function dblog_watchdog

Same name and namespace in other branches
  1. 6.x drupal-6.x/modules/dblog/dblog.module \dblog_watchdog()

Implements hook_watchdog().

Note: Some values may be truncated to meet database column size restrictions.

2 calls to dblog_watchdog()
DBLogTestCase::generateLogEntries in drupal-7.x/modules/dblog/dblog.test
Generates a number of random database log events.
DBLogTestCase::testDBLogAddAndClear in drupal-7.x/modules/dblog/dblog.test
Tests the addition and clearing of log events through the admin interface.

Archivo

drupal-7.x/modules/dblog/dblog.module, line 146
System monitoring and logging for administrators.

Código

function dblog_watchdog(array $log_entry) {
  Database::getConnection('default', 'default')->insert('watchdog')->fields(array(
    'uid' => $log_entry['uid'],
    'type' => substr($log_entry['type'], 0, 64),
    'message' => $log_entry['message'],
    'variables' => serialize($log_entry['variables']),
    'severity' => $log_entry['severity'],
    'link' => substr($log_entry['link'], 0, 255),
    'location' => $log_entry['request_uri'],
    'referer' => $log_entry['referer'],
    'hostname' => substr($log_entry['ip'], 0, 128),
    'timestamp' => $log_entry['timestamp'],
  ))->execute();
}