protected function SensorRunner::needsLogging in Monitoring 8
Same name and namespace in other branches
- 7 lib/Drupal/monitoring/SensorRunner.php \Drupal\monitoring\SensorRunner::needsLogging()
Checks if sensor results should be logged.
Parameters
\Drupal\monitoring\Result\SensorResultInterface $result: The sensor result.
string $old_status: The old sensor status.
string $new_status: Thew new sensor status.
Return value
bool TRUE if the result should be logged, FALSE if not.
1 call to SensorRunner::needsLogging()
- SensorRunner::logResults in src/
SensorRunner.php - Log results if needed.
File
- src/
SensorRunner.php, line 252 - Contains \Drupal\monitoring\SensorRunner.
Class
- SensorRunner
- Instantiate and run requested sensors.
Namespace
Drupal\monitoringCode
protected function needsLogging($result, $old_status = NULL, $new_status = NULL) {
$log_activity = $result
->getSensorConfig()
->getSetting('result_logging', FALSE);
// We log if requested or on status change.
if ($this->config
->get('sensor_call_logging') == 'on_request') {
return $log_activity || $old_status != $new_status;
}
// We are logging all.
if ($this->config
->get('sensor_call_logging') == 'all') {
return TRUE;
}
return FALSE;
}