Skip to content

Commit f31bd1f

Browse files
committed
#44 Send Memcache errors and warnings to Drupal logs, downgrade errors to warnings.
1 parent a988c26 commit f31bd1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

_ping.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -746,15 +746,18 @@ protected function check2(): void {
746746

747747
if ($good_count > 0 && $bad_count > 0) {
748748
$this->setStatus('warning', 'Connection warnings.', ['warnings' => $msgs]);
749+
\Drupal::logger('drupal_ping')->warning('Memcache connection warning. Warning messages: @warnings', ['@warnings' => json_encode($msgs)]);
749750
return;
750751
}
751752

752753
if ($good_count < 1 && $bad_count > 0) {
753754
$this->setStatus('warning', 'Connection errors.', ['errors' => $msgs]);
755+
\Drupal::logger('drupal_ping')->error('Memcache connection error. Error messages: @errors', ['@errors' => json_encode($msgs)]);
754756
return;
755757
}
756758

757-
$this->setStatus('error', 'Internal error.');
759+
\Drupal::logger('drupal_ping')->error('Memcache internal error.');
760+
$this->setStatus('warning', 'Internal error.');
758761
}
759762

760763
}

0 commit comments

Comments
 (0)