public function SensorDblog404::buildQuery in Monitoring 7
Builds the database query.
Return value
Overrides SensorDatabaseAggregator::buildQuery
File
- lib/
Drupal/ monitoring/ Sensor/ Sensors/ SensorDblog404.php, line 21 - Contains \Drupal\monitoring\Sensor\Sensors\SensorDblog404.
Class
- SensorDblog404
- Monitors 404 page errors from dblog.
Namespace
Drupal\monitoring\Sensor\SensorsCode
public function buildQuery() {
$query = parent::buildQuery();
$query
->addField('watchdog', 'message');
// The message is the requested 404 URL.
$query
->groupBy('message');
$query
->orderBy('records_count', 'DESC');
$query
->range(0, 1);
return $query;
}