function acquia_spi_get_watchdog_data in Acquia Connector 7.3
Same name and namespace in other branches
- 6.2 acquia_spi/acquia_spi.module \acquia_spi_get_watchdog_data()
- 7.2 acquia_spi/acquia_spi.module \acquia_spi_get_watchdog_data()
Get the latest (last hour) critical and emergency warnings from watchdog.
These errors are 'severity' 0 and 2.
Return value
array Array of errors.
1 call to acquia_spi_get_watchdog_data()
- acquia_spi_get in acquia_spi/
acquia_spi.module - Gather site profile information about this site.
File
- acquia_spi/
acquia_spi.module, line 1241 - Send site profile information (NSPI) and system data to Acquia Insight.
Code
function acquia_spi_get_watchdog_data() {
$wd = array();
if (module_exists('dblog')) {
$result = db_select('watchdog', 'w')
->fields('w', array(
'wid',
'severity',
'type',
'message',
'timestamp',
))
->condition('w.severity', array(
WATCHDOG_EMERGENCY,
WATCHDOG_CRITICAL,
), 'IN')
->condition('w.timestamp', REQUEST_TIME - 3600, '>')
->execute();
while ($record = $result
->fetchAssoc()) {
$wd[$record['severity']] = $record;
}
}
return $wd;
}