Commit d284646f by 朱瑞泽

强制使用log4j2输出日志

parent fccd54e1
......@@ -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.vo.DemoStoreVO;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/demo")
public class DemoProjectController {
private static final Logger logger = LoggerFactory.getLogger(DemoProjectController.class);
private final Logger logger = LogManager.getLogger(DemoProjectController.class);
@Autowired
private DemoStoreApiService demoStoreApiService;
......
package com.gic.demo.project.web.exception;
import com.gic.commons.webapi.reponse.RestResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -18,7 +18,8 @@ import java.io.PrintWriter;
*/
@ControllerAdvice
public class GlobalExceptionHandler {
private static Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
private final Logger logger = LogManager.getLogger(GlobalExceptionHandler.class);
@ResponseBody
@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