function Drupal::logger
Same name in other branches
- 9 core/lib/Drupal.php \Drupal::logger()
- 10 core/lib/Drupal.php \Drupal::logger()
- 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.
10 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.
- file_unmanaged_prepare in core/
includes/ file.inc - Internal function that prepares the destination for a file_unmanaged_copy or file_unmanaged_move operation.
- locale_translate_batch_finished in core/
modules/ locale/ locale.bulk.inc - Implements callback_batch_finished().
File
-
core/
lib/ Drupal.php, line 716
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.