Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::logger()
  2. 9 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::logger()

Gets the logger for a specific channel.

This method exists for backward-compatibility between FormBase and LoggerChannelTrait. Use LoggerChannelTrait::getLogger() instead.

Parameters

string $channel: The name of the channel. Can be any string, but the general practice is to use the name of the subsystem calling this.

Return value

\Psr\Log\LoggerInterface The logger for the given channel.

24 calls to FormBase::logger()
BanDelete::submitForm in core/modules/ban/src/Form/BanDelete.php
Form submission handler.
BlockContentForm::save in core/modules/block_content/src/BlockContentForm.php
Form submission handler for the 'save' action.
BlockContentTypeForm::save in core/modules/block_content/src/BlockContentTypeForm.php
Form submission handler for the 'save' action.
BookAdminEditForm::submitForm in core/modules/book/src/Form/BookAdminEditForm.php
Form submission handler.
ContactFormEditForm::save in core/modules/contact/src/ContactFormEditForm.php
Form submission handler for the 'save' action.

... See full list

File

core/lib/Drupal/Core/Form/FormBase.php, line 244

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function logger($channel) {
  return $this
    ->getLogger($channel);
}