environmentRepository->find($envId) : null; if (null === $environment) { throw new NotFoundHttpException(sprintf('Environment "%s" not found.', $envId)); } $logFile = $logFileId ? $this->logFileRepository->find($logFileId) : null; if (null === $logFile || $logFile->getEnvironment()?->getId() !== $environment->getId()) { throw new NotFoundHttpException(sprintf('Log file "%s" not found.', $logFileId)); } $request = $this->requestStack->getCurrentRequest(); $lines = (int) ($request?->query->get('lines', '100') ?? 100); $level = $request?->query->get('level'); $content = $this->logService->getSymfonyLog( $environment->getContainerName(), $logFile->getPath(), $lines, $level, ); $dto = new LogOutput(); $dto->content = $content; $dto->lines = $lines; $dto->source = sprintf('symfony:%s', $logFile->getLabel()); return $dto; } }