loggerChannelFactory = $logger_channel_factory; $this->configFactory = $config_factory; } /** * {@inheritdoc} */ public function get($channel) { if ($channel == 'page not found' && $this->configFactory->get('redirect_404.settings')->get('suppress_404')) { // Do not log if a 404 error is detected and the suppress_404 is enabled. return new NullLogger(); } // Call LoggerChannelFactory to let the default logger workflow proceed. return $this->loggerChannelFactory->get($channel); } /** * {@inheritdoc} */ public function addLogger(LoggerInterface $logger, $priority = 0) { $this->loggerChannelFactory->addLogger($logger, $priority); } }