Deprecate/remove LoggerChannelInterface

Created on 4 July 2016, over 8 years ago
Updated 4 April 2023, over 1 year ago

Problem/Motivation

LoggerChannelInterface is an implementation detail of drupal core, which extends LoggerInterface, a PSR standard.
Our docs/typehints must always use the PSR interface and not the Drupal core specific for maximum interoperability.
We should have never added this interface actually :/

While it sounds completely reasonable we also need to figure out where to put documentation that this interface currently provide(from 9.2.x):

/**
 * Logger channel interface.
 *
 * This interface defines the full behavior of the central Drupal logger
 * facility. However, when writing code that does logging, use the generic
 * \Psr\Log\LoggerInterface for typehinting instead (you shouldn't need the
 * methods here).
 *
 * To add a new logger to the system, implement \Psr\Log\LoggerInterface and
 * add a service for that class to a services.yml file tagged with the 'logger'
 * tag. The default logger channel implementation will call the log() method
 * of every logger service with some useful data set in the $context argument
 * of log(): request_uri, referer, ip, user, uid.
 *
 * SECURITY NOTE: the caller might also set a 'link' in the $context array
 * which will be printed as-is by the dblog module under an "operations"
 * header. Usually this is a "view", "edit" or similar relevant link. Make sure
 * to use proper, secure link generation facilities; some are listed below.
 *
 * @see \Drupal\Core\Logger\RfcLoggerTrait
 * @see \Psr\Log\LoggerInterface
 * @see \Drupal\Core\Logger\\LoggerChannelFactoryInterface
 * @see \Drupal\Core\Utility\LinkGeneratorInterface
 * @see \Drupal\Core\Link::fromTextAndUrl()
 * @see \Drupal\Core\Entity\EntityInterface::link()
 */

Proposed resolution

TBD

Remaining tasks

Agree on where to move documentation
Patch
Review
Draft CR
Commit
Publish CR

User interface changes

None

API changes

None?

Data model changes

None

Release notes snippet

TBD

📌 Task
Status

Needs work

Version

10.1

Component
Base 

Last updated about 13 hours ago

Created by

🇨🇭Switzerland ParisLiakos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024