Issue #3381078 by mfb, smustgrave, xjm, quietone, andypost: Demote routine log events from "notice" to "info"
parent
1f9f44416b
commit
9c025861d9
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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(),
|
||||
]);
|
||||
|
|
|
@ -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()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue