This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package SuMoC.backend.logger;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
@Controller
|
||||
public class LogPageController {
|
||||
|
||||
@GetMapping("/logs")
|
||||
public String logs(Model model) throws IOException {
|
||||
String content = Files.readString(Path.of("logs/app.log"));
|
||||
model.addAttribute("logs", content);
|
||||
return "logs";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user