Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::logger()
  2. 9 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.

55 calls to Drupal::logger()
authorize.php in core/authorize.php
Administrative script for running authorized file operations.
comment_entity_view_display_presave in core/modules/comment/comment.module
Implements hook_ENTITY_TYPE_presave() for entity_view_display entities.
ConfigEntityUpdater::update in core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php
Updates configuration entities as part of a Drupal update.
ConfigImporterBatch::finish in core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php
Finish batch.
CronAccessCheck::access in core/modules/system/src/Access/CronAccessCheck.php
Checks access.

... See full list

File

core/lib/Drupal.php, line 675

Class

Drupal
Static Service Container wrapper.

Code

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