request = $request; $this->logger = $logger; } /** * Logger invalidate cache * @param mixed $invalidateInfo * @return void */ public function execute($invalidateInfo) { $this->logger->debug('cache_invalidate: ', $this->makeParams($invalidateInfo)); } /** * Make extra data to logger message * @param mixed $invalidateInfo * @return array */ private function makeParams($invalidateInfo) { $method = $this->request->getMethod(); $url = $this->request->getUriString(); return compact('method', 'url', 'invalidateInfo'); } /** * Log critical * * @param string $message * @param mixed $params * @return void */ public function critical($message, $params) { $this->logger->critical($message, $this->makeParams($params)); } }