Issue #3381078 by mfb, smustgrave, xjm, quietone, andypost: Demote routine log events from "notice" to "info"

merge-requests/5334/head
xjm 2023-11-10 09:17:08 -06:00
parent 1f9f44416b
commit 9c025861d9
No known key found for this signature in database
GPG Key ID: 206B0B8743BDF4C2
7 changed files with 9 additions and 9 deletions

View File

@ -143,7 +143,7 @@ class EmailAction extends ConfigurableActionBase implements ContainerFactoryPlug
$message = $this->mailManager->mail('system', 'action_send_email', $recipient, $langcode, $params);
// Error logging is handled by \Drupal\Core\Mail\MailManager::mail().
if ($message['result']) {
$this->logger->notice('Sent email to %recipient', ['%recipient' => $recipient]);
$this->logger->info('Sent email to %recipient', ['%recipient' => $recipient]);
}
}

View File

@ -381,7 +381,7 @@ class CommentForm extends ContentEntityForm {
$form_state->setValue('cid', $comment->id());
// Add a log entry.
$logger->notice('Comment posted: %subject.', [
$logger->info('Comment posted: %subject.', [
'%subject' => $comment->getSubject(),
'link' => Link::fromTextAndUrl(t('View'), $comment->toUrl()->setOption('fragment', 'comment-' . $comment->id()))->toString(),
]);

View File

@ -44,7 +44,7 @@ class DeleteForm extends ContentEntityDeleteForm {
* {@inheritdoc}
*/
public function logDeletionMessage() {
$this->logger('comment')->notice('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);
$this->logger('comment')->info('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);
}
}

View File

@ -133,14 +133,14 @@ class MailHandler implements MailHandlerInterface {
}
if (!$message->isPersonal()) {
$this->logger->notice('%sender-name (@sender-from) sent an email regarding %contact_form.', [
$this->logger->info('%sender-name (@sender-from) sent an email regarding %contact_form.', [
'%sender-name' => $sender_cloned->getAccountName(),
'@sender-from' => $sender_cloned->getEmail() ?? '',
'%contact_form' => $contact_form->label(),
]);
}
else {
$this->logger->notice('%sender-name (@sender-from) sent %recipient-name an email.', [
$this->logger->info('%sender-name (@sender-from) sent %recipient-name an email.', [
'%sender-name' => $sender_cloned->getAccountName(),
'@sender-from' => $sender_cloned->getEmail(),
'%recipient-name' => $message->getPersonalRecipient()->getAccountName(),

View File

@ -135,7 +135,7 @@ class MailHandlerTest extends UnitTestCase {
*/
public function testSendMailMessages(MessageInterface $message, AccountInterface $sender, $results) {
$this->logger->expects($this->once())
->method('notice');
->method('info');
$this->mailManager->expects($this->any())
->method('mail')
->willReturnCallback(

View File

@ -95,7 +95,7 @@ class SearchController extends ControllerBase {
if ($plugin->isSearchExecutable()) {
// Log the search.
if ($this->config('search.settings')->get('logging')) {
$this->logger->notice('Searched %type for %keys.', ['%keys' => $keys, '%type' => $entity->label()]);
$this->logger->info('Searched %type for %keys.', ['%keys' => $keys, '%type' => $entity->label()]);
}
// Collect the search results.

View File

@ -201,12 +201,12 @@ class TermForm extends ContentEntityForm {
switch ($result) {
case SAVED_NEW:
$this->messenger()->addStatus($this->t('Created new term %term.', ['%term' => $view_link]));
$this->logger('taxonomy')->notice('Created new term %term.', ['%term' => $term->getName(), 'link' => $edit_link]);
$this->logger('taxonomy')->info('Created new term %term.', ['%term' => $term->getName(), 'link' => $edit_link]);
break;
case SAVED_UPDATED:
$this->messenger()->addStatus($this->t('Updated term %term.', ['%term' => $view_link]));
$this->logger('taxonomy')->notice('Updated term %term.', ['%term' => $term->getName(), 'link' => $edit_link]);
$this->logger('taxonomy')->info('Updated term %term.', ['%term' => $term->getName(), 'link' => $edit_link]);
$form_state->setRedirect('entity.taxonomy_term.canonical', ['taxonomy_term' => $term->id()]);
break;
}