diff -u b/lib/Drupal/monitoring/Sensor/Sensors/SensorPhpNotices.php b/lib/Drupal/monitoring/Sensor/Sensors/SensorPhpNotices.php --- b/lib/Drupal/monitoring/Sensor/Sensors/SensorPhpNotices.php +++ b/lib/Drupal/monitoring/Sensor/Sensors/SensorPhpNotices.php @@ -35,7 +35,7 @@ if (!empty($this->fetchedObject->variables)) { $variables = unserialize($this->fetchedObject->variables); $variables['%file'] = $this->shortenFilename($variables['%file']); - $result->setMessage('@count times: @error', ['@count' => (int) $this->fetchedObject->records_count, '@error' => new FormattableMarkup('%type: @message in %function (Line %line of %file).', $variables)]); + $result->setMessage('@count times: @error', ['@count' => (int) $this->fetchedObject->records_count, '@error' => t('%type: @message in %function (Line %line of %file).', $variables)]); }; } @@ -74,7 +74,7 @@ /** * {@inheritdoc} */ - public function verboseResultUnaggregated(array &$output) { + /*public function verboseResultUnaggregated(array &$output) { $output['verbose_sensor_result'] = array( '#theme' => 'table', '#title' => t('Unaggregated result'), @@ -109,7 +109,7 @@ $output['verbose_sensor_result']['#rows'][$delta]['wid'] = l($row['wid'], url('/admin/reports/dblog/event/' . $row['wid'])); // Replace variables in message. - $output['verbose_sensor_result']['#rows'][$delta]['message'] = new FormattableMarkup($row['message'], unserialize($row['variables'])); + $output['verbose_sensor_result']['#rows'][$delta]['message'] = t($row['message'], unserialize($row['variables'])); // Do not render the raw message & variables in the row. unset($output['verbose_sensor_result']['#rows'][$delta]['variables']); $variables = unserialize($row['variables']); @@ -134,7 +134,7 @@ } $output['verbose_sensor_result']['#rows'] = $rows; $output['verbose_sensor_result']['#header'] = $this->buildTableHeader($rows); - } + }*/ protected function buildTableHeader($rows = []) { $header = [ only in patch2: unchanged: --- a/monitoring.monitoring_sensors.inc +++ b/monitoring.monitoring_sensors.inc @@ -376,6 +376,21 @@ function monitoring_dblog_monitoring_sensor_info() { ); } + $info['php_notices'] = array( + 'label' => 'PHP notices (database log)', + 'description' => 'Displays the most frequent PHP notices and errors.', + 'sensor_class' => 'Drupal\monitoring\Sensor\Sensors\SensorPhpNotices', + 'value_label' => 'Watchdog events', + 'settings' => array( + 'category' => 'Watchdog', + // Cache for one hour. + 'caching_time' => 3600, + 'table' => 'watchdog', + 'time_interval_field' => 'timestamp', + 'time_interval_value' => 60 * 60 * 24, + ), + ); + return $info; }