config->getSystemValue('logdateformat', \DateTime::ATOM); $timezone = $this->config->getSystemValue('logtimezone', 'UTC'); $logType = $this->config->getSystemValue('log_type', 'file'); if ($logType !== 'file') { throw new UnsupportedLogTypeException(); } $log = $this->logFactory->get('file'); if ($log instanceof IFileBased) { $handle = fopen($log->getLogFilePath(), 'rb'); if ($handle) { $iterator = new LogIterator($handle, $dateFormat, $timezone); return new \CallbackFilterIterator($iterator, function ($logItem) use ($levels) { return $logItem && in_array($logItem['level'], $levels); }); } else { throw new \Exception('Error while opening ' . $log->getLogFilePath()); } } throw new \Exception('Can\'t find log class'); } }