异常日志打印
parent
7a61163c6c
commit
5472a418a2
|
@ -50,6 +50,7 @@ public class WebLogAspect {
|
|||
proceed = proceedingJoinPoint.proceed();
|
||||
} catch (Throwable throwable) {
|
||||
logger.error(throwable.getMessage(), throwable);
|
||||
throw new RuntimeException(throwable);
|
||||
}
|
||||
|
||||
logger.info("RESPONSE : " + proceed);
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package cn.palmte.work.controller.backend;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* @author xiongshiyan
|
||||
*/
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
||||
|
||||
@ExceptionHandler(value=Exception.class)
|
||||
public void allExceptionHandler(Exception e) throws Exception {
|
||||
logger.error(e.getMessage() , e);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue