如何使用空catch块记录Spring AOP中的异常详细信息?

时间:2017-05-17 06:37:09

标签: spring exception-handling spring-aop

使用空catch块在Spring AOP中记录异常详细信息。 例如:

  try {
        int data = 50 / 0;

    } catch (Exception e) {

    }

异常不在spring aop中打印堆栈跟踪以获取空捕获方法

我正在使用“@AfterThrowing”,但它不起作用。请找到以下代码:

@AfterThrowing(pointcut =“catsServiceLevelLog()”,throw =“ex”)

public void exceptionAdvice(Throwable ex)抛出Throwable {

}

0 个答案:

没有答案
相关问题