log = $logger; } /** * download logfile * * @return StreamResponse * * 200: Logfile returned */ #[NoCSRFRequired] #[OpenAPI(scope: OpenAPI::SCOPE_ADMINISTRATION)] public function download() { if (!$this->log instanceof Log) { throw new \UnexpectedValueException('Log file not available'); } return new StreamResponse( $this->log->getLogPath(), Http::STATUS_OK, [ 'Content-Type' => 'application/octet-stream', 'Content-Disposition' => 'attachment; filename="nextcloud.log"', ], ); } }