com.the_qa_company.qendpoint.controller.LogController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qendpoint-backend Show documentation
Show all versions of qendpoint-backend Show documentation
SPARQL Endpoint of the qendpoint.
package com.the_qa_company.qendpoint.controller;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/actuator")
public class LogController {
@Autowired
Sparql sparql;
@GetMapping("/logfile")
public void readLog(HttpServletResponse response) throws IOException {
response.setContentType("text/plain");
response.setHeader("Content-Disposition", "inline;filename=\"logs.output\"");
sparql.writeLogs(response.getOutputStream());
}
}