LoggerChannelTrait
trait LoggerChannelTrait (View source)
Wrapper methods for the logger factory service.
This utility trait should only be used in application-level code, such as classes that would implement ContainerInjectionInterface. Services registered in the Container should not use this trait but inject the appropriate service directly for easier testing.
Properties
| protected LoggerChannelFactoryInterface | $loggerFactory | The logger channel factory service. |
Methods
LoggerInterface
getLogger(string $channel)
Gets the logger for a specific channel.
$this
Details
protected LoggerInterface
getLogger(string $channel)
Gets the logger for a specific channel.
$this
setLoggerFactory(LoggerChannelFactoryInterface $logger_factory)
Injects the logger channel factory.