function Drupal::logger

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

7 calls to Drupal::logger()
ConfigImporterBatch::finish in core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php
Finish batch.
EntityDisplayBase::getLogger in core/lib/Drupal/Core/Entity/EntityDisplayBase.php
Provides the 'system' channel logger service.
OliveroTest::testPagerAttribute in core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
Tests pager attribute is present using pager_test.
RecipeRunner::processContent in core/lib/Drupal/Core/Recipe/RecipeRunner.php
Creates content contained in a recipe.
SqlContentEntityStorage::delete in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
Deletes permanently saved entities.

... 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.