protected function applyError(
        CacheItem $cacheItem,
        $status,
        $message,
        $inputFilename,
        $templateType,
        $templateKey,
        $logSeverity = 'error'
    ) {
        $cacheItem
            ->setCacheStatus($status)
            ->setError($message);

        $logger = $this->getLogger();
        if ($logger && method_exists($logger, $logSeverity)) {
            $logger->$logSeverity($message, array(
                'worker' => get_class($this),
                'templateType' => $templateType,
                'templateKey' => $templateKey,
                'fileId' => $cacheItem->getFileId(),
                'fileVersion' => $cacheItem->getFileVersion(),
                'fileMimeType' => $cacheItem->getMimeType(),
                'fileMediaType' => $cacheItem->getMediaType(),
                'inputFile' => $inputFilename,
            ));
        }
    }