You are here

public static function Drupal::logger in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal.php \Drupal::logger()

Returns a channel logger object.

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 this channel.

9 calls to Drupal::logger()
ConfigImporterBatch::finish in core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php
Finish batch.
DbLogFormInjectionTest::setUp in core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php
EntityDisplayBase::getLogger in core/lib/Drupal/Core/Entity/EntityDisplayBase.php
Provides the 'system' channel logger service.
locale_translate_batch_finished in core/modules/locale/locale.bulk.inc
Implements callback_batch_finished().
locale_translation_http_check in core/modules/locale/locale.batch.inc
Check if remote file exists and when it was last updated.

... See full list

File

core/lib/Drupal.php, line 673

Class

Drupal
Static Service Container wrapper.

Code

public static function logger($channel) {
  return static::getContainer()
    ->get('logger.factory')
    ->get($channel);
}