如何在 Spring Boot 中調(diào)試請求?
我的電腦重新啟動(dòng),我的應(yīng)用程序今天不再運(yùn)行。昨天還在工作。除了 Maven 下載新庫(主要是 Amazon)之外,沒有任何改變?,F(xiàn)在我什至無法訪問該/admin/login頁面。如何調(diào)試請求?2019-09-13 17:26:16.924 INFO 2056 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/admin/login],methods=[GET]}" onto public java.lang.String com.s.s.controller.Controller.login()2019-09-13 17:26:21.465 ERROR 2056 --- [nio-8080-exec-1] c.s.s.c.Controller : invalidRequest(): invalid request: /admin/login@RequestMapping(value="/admin/login", method=RequestMethod.GET)public String login() { return "login";}@RequestMapping("/error")public void invalidRequest(HttpServletRequest request, HttpServletResponse response){ Logger.error(TAG, "invalidRequest()", "invalid request: " + request.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI)); try { response.setStatus(HttpStatus.OK.value()); response.getWriter().write("This is not a valid request"); } catch (IOException e) { Logger.error(TAG, "invalidRequest: ", "Exception in invalidRequest() method "+e.getMessage()); }}@Overridepublic String getErrorPath() { return "/error";}我設(shè)置了這一行,application.properties但它沒有打印任何額外的內(nèi)容。logging.level.com.s.s.controller.Controller=DEBUG我運(yùn)行mvn clean并重新啟動(dòng)服務(wù)器,但沒有幫助。我設(shè)置了這一行,application.properties但它沒有打印任何有用的內(nèi)容。debug=true我在 Makgigrahul 的答案中找到了以下搜索內(nèi)容spring-sleuth,并將其添加到application.properties生成此日志中。logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG
查看完整描述