Commit d284646f by 朱瑞泽

强制使用log4j2输出日志

parent fccd54e1
...@@ -8,8 +8,8 @@ import com.gic.demo.project.api.service.DemoStoreApiService; ...@@ -8,8 +8,8 @@ import com.gic.demo.project.api.service.DemoStoreApiService;
import com.gic.demo.project.web.exception.GicDemoErrCode; import com.gic.demo.project.web.exception.GicDemoErrCode;
import com.gic.demo.project.web.vo.DemoStoreVO; import com.gic.demo.project.web.vo.DemoStoreVO;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.apache.logging.log4j.LogManager;
import org.slf4j.LoggerFactory; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/demo") @RequestMapping("/demo")
public class DemoProjectController { public class DemoProjectController {
private static final Logger logger = LoggerFactory.getLogger(DemoProjectController.class); private final Logger logger = LogManager.getLogger(DemoProjectController.class);
@Autowired @Autowired
private DemoStoreApiService demoStoreApiService; private DemoStoreApiService demoStoreApiService;
......
package com.gic.demo.project.web.exception; package com.gic.demo.project.web.exception;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import org.slf4j.Logger; import org.apache.logging.log4j.LogManager;
import org.slf4j.LoggerFactory; import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -18,7 +18,8 @@ import java.io.PrintWriter; ...@@ -18,7 +18,8 @@ import java.io.PrintWriter;
*/ */
@ControllerAdvice @ControllerAdvice
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
private static Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
private final Logger logger = LogManager.getLogger(GlobalExceptionHandler.class);
@ResponseBody @ResponseBody
@ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment