로그 추가
This commit is contained in:
@@ -2,6 +2,8 @@ package com.eactive.testmaster.common.exception;
|
||||
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.web.servlet.error.ErrorController;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@@ -10,6 +12,9 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
public class PortalErrorController implements ErrorController {
|
||||
//logger from loggerfactory
|
||||
private static final Logger logger = LoggerFactory.getLogger(PortalErrorController.class);
|
||||
|
||||
|
||||
@GetMapping("/error")
|
||||
public String handleError(HttpServletRequest request, ModelMap model) {
|
||||
@@ -25,6 +30,7 @@ public class PortalErrorController implements ErrorController {
|
||||
|
||||
@PostMapping("/error")
|
||||
public String handleErrorPost(HttpServletRequest request, ModelMap model) {
|
||||
logger.error("Request: " + request.getPathInfo());
|
||||
Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
|
||||
|
||||
if (status != null) {
|
||||
|
||||
Reference in New Issue
Block a user