类org.aspectj.lang.annotation.AfterThrowing源码实例Demo

下面列出了怎么用org.aspectj.lang.annotation.AfterThrowing的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: mySpringBoot   文件: AspectLog.java
/**
 * 调用后的异常处理
 * @param p
 * @param e
 */
@AfterThrowing(pointcut = "methodCachePointcut()", throwing = "e")
public void doAfterThrowing(JoinPoint p, Throwable e) throws Throwable {
    //业务异常不用记录
    if(!(e instanceof ServiceException)) {
        try {
            SystemLog systemLog =getSystemLogInit(p);
            systemLog.setLogType(SystemLog.LOGERROR);
            systemLog.setExceptionCode(e.getClass().getName());
            systemLog.setExceptionDetail(e.getMessage());
            systemLogQueue.add(systemLog);
        } catch (Exception ex) {
            logger.error("==异常通知异常==");
            logger.error("异常信息:{}", ex.getMessage());
        }
    }
}
 
源代码2 项目: jhipster-online   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice.
 * @param e exception.
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
        logger(joinPoint)
            .error(
                "Exception in {}() with cause = \'{}\' and exception = \'{}\'",
                joinPoint.getSignature().getName(),
                e.getCause() != null ? e.getCause() : "NULL",
                e.getMessage(),
                e
            );
    } else {
        logger(joinPoint)
            .error(
                "Exception in {}() with cause = {}",
                joinPoint.getSignature().getName(),
                e.getCause() != null ? e.getCause() : "NULL"
            );
    }
}
 
源代码3 项目: sk-admin   文件: LogAspect.java
/**
 * 配置异常通知
 *
 * @param joinPoint join point for advice
 * @param e         exception
 */
@AfterThrowing(pointcut = "logPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    Log log = new Log("ERROR", System.currentTimeMillis() - currentTime.get());
    currentTime.remove();
    log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes());
    HttpServletRequest request = SecurityUtils.getHttpServletRequest();
    logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log);
}
 
源代码4 项目: eventapis   文件: EventExecutionInterceptor.java
@AfterThrowing(value = "this(com.kloia.eventapis.api.EventHandler+) && execution(* execute(..))", throwing = "exception")
public void afterThrowing(Exception exception) throws Throwable {
    try {
        log.debug("afterThrowing EventHandler method:" + exception.getMessage());
        kafkaOperationRepository.failOperation(operationContext.getCommandContext(), event -> event.setEventState(EventState.TXN_FAILED));
    } finally {
        operationContext.clearCommandContext();
        userContext.clearUserContext();
    }
}
 
源代码5 项目: eventapis   文件: CommandExecutionInterceptor.java
@AfterThrowing(value = "this(com.kloia.eventapis.api.CommandHandler) && @annotation(command)", throwing = "exception")
public void afterThrowing(Command command, Exception exception) {
    try {
        log.info("afterThrowing Command: " + exception);
        kafkaOperationRepository.failOperation(operationContext.getCommandContext(), event -> event.setEventState(EventState.TXN_FAILED));
    } finally {
        operationContext.clearCommandContext();
    }
}
 
源代码6 项目: flair-registry   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "loggingPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码7 项目: mogu_blog_v2   文件: LoggerAspect.java
@AfterThrowing(value = "pointcut(operationLogger)", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, OperationLogger operationLogger, Throwable e) throws Exception {

    ExceptionLog exception = new ExceptionLog();
    HttpServletRequest request = RequestHolder.getRequest();
    String ip = IpUtils.getIpAddr(request);
    exception.setIp(ip);
    String operationName = AspectUtil.INSTANCE.parseParams(joinPoint.getArgs(), operationLogger.value());

    //从Redis中获取IP来源
    String jsonResult = redisUtil.get(SysConf.IP_SOURCE + BaseSysConf.REDIS_SEGMENTATION + ip);
    if (StringUtils.isEmpty(jsonResult)) {
        String addresses = IpUtils.getAddresses(SysConf.IP + SysConf.EQUAL_TO + ip, SysConf.UTF_8);
        if (StringUtils.isNotEmpty(addresses)) {
            exception.setIpSource(addresses);
            redisUtil.setEx(SysConf.IP_SOURCE + BaseSysConf.REDIS_SEGMENTATION + ip, addresses, 24, TimeUnit.HOURS);
        }
    } else {
        exception.setIpSource(jsonResult);
    }

    //设置请求信息
    exception.setIp(ip);

    //设置调用的方法
    exception.setMethod(joinPoint.getSignature().getName());

    exception.setExceptionJson(JSON.toJSONString(e,
            SerializerFeature.DisableCircularReferenceDetect,
            SerializerFeature.WriteMapNullValue));
    exception.setExceptionMessage(e.getMessage());

    exception.setOperation(operationName);
    exception.setCreateTime(new Date());
    exception.setUpdateTime(new Date());

    exception.insert();
}
 
源代码8 项目: flair-engine   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码9 项目: springboot-seed   文件: ServiceMonitor.java
/**
 * Monitor whether exception is thrown in service layer. If exception
 * has been thrown, in order to detecting it conveniently, log the
 * situation where it happened. Then create a server internal error
 * exception and throw it out.
 */
@AfterThrowing(pointcut = "com.wind.monitor.ServiceMonitor.serviceLayer()", throwing = "e")
public void monitorException(JoinPoint joinPoint, Throwable e) {
    // Log the situation where exception happened
    Object[] args = joinPoint.getArgs();
    Signature signature = joinPoint.getSignature();
    log.error("[" + signature.toShortString() + "]" + Arrays.toString(args) + "[" + e.toString() + "]");

    // Throw a new server internal error exception
    throw new ServerInternalErrorException(e.getMessage(), e);
}
 
源代码10 项目: sophia_scaffolding   文件: ApiLogAspect.java
/**
 * 异常通知
 *
 * @param e
 */
@AfterThrowing(pointcut = "log()", throwing = "e")
public void doAfterThrowable(Throwable e) {
    //得到当前线程的log对象
    ApiLogger apiLogger = logThreadLocal.get();
    // 发布事件
    publisher.publishEvent(new SysLogEvent(apiLogger));
    //移除当前log实体
    logThreadLocal.remove();
}
 
源代码11 项目: sophia_scaffolding   文件: ApiLogAspect.java
/**
 * 异常通知
 *
 * @param e
 */
@AfterThrowing(pointcut = "log()", throwing = "e")
public void doAfterThrowable(Throwable e) {
    //得到当前线程的log对象
    ApiLogger apiLogger = logThreadLocal.get();
    // 发布事件
    publisher.publishEvent(new SysLogEvent(apiLogger));
    //移除当前log实体
    logThreadLocal.remove();
}
 
源代码12 项目: alfresco-repository   文件: RouteTestExtesnions.java
@AfterThrowing(pointcut = "execution(@org.alfresco.traitextender.Extend * *(..) throws TestException) && (@annotation(extendAnnotation))", throwing = "ete")
public void intercept(Extend extendAnnotation, ExtensionTargetException ete) throws TestException
{
    Throwable exception = AJExtender.asCheckThrowable(ete.getCause(),
                                                      TestException.class);
    if (exception instanceof TestException)
    {
        throw (TestException) exception;
    }
    else
    {
        throw ete;
    }
}
 
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice.
 * @param e exception.
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice.
 * @param e exception.
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice.
 * @param e exception.
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码16 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码17 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码18 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码19 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码20 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码21 项目: lams   文件: AbstractAspectJAdvisorFactory.java
/**
 * Find and return the first AspectJ annotation on the given method
 * (there <i>should</i> only be one anyway...)
 */
@SuppressWarnings("unchecked")
protected static AspectJAnnotation<?> findAspectJAnnotationOnMethod(Method method) {
	Class<?>[] classesToLookFor = new Class<?>[] {
			Before.class, Around.class, After.class, AfterReturning.class, AfterThrowing.class, Pointcut.class};
	for (Class<?> c : classesToLookFor) {
		AspectJAnnotation<?> foundAnnotation = findAnnotation(method, (Class<Annotation>) c);
		if (foundAnnotation != null) {
			return foundAnnotation;
		}
	}
	return null;
}
 
源代码22 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码23 项目: cubeai   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
源代码24 项目: summerframework   文件: GenericControllerAspect.java
@Override
@AfterThrowing(pointcut = "allPublicControllerMethodsPointcut() || methodOrClassMonitorEnabledPointcut()",
    throwing = "t")
public void onException(JoinPoint joinPoint, Throwable t) {
    String methodName = joinPoint.getSignature().getName() + "()";
    LOG.info(methodName + " threw exception: [" + t + "]");
}
 
源代码25 项目: klask-io   文件: LoggingAspect.java
@AfterThrowing(pointcut = "loggingPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = {} and exception {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause(), e);
    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause());
    }
}
 
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
    }
}
 
@AfterThrowing(value = "@annotation(klock)", throwing = "ex")
public void afterThrowing (JoinPoint joinPoint, Klock klock, Throwable ex) throws Throwable {
    String curentLock = this.getCurrentLockId(joinPoint,klock);
    releaseLock(klock, joinPoint,curentLock);
    cleanUpThreadLocal(curentLock);
    throw ex;
}
 
源代码30 项目: TeamDojo   文件: LoggingAspect.java
/**
 * Advice that logs methods throwing exceptions.
 *
 * @param joinPoint join point for advice
 * @param e         exception
 */
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
    if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
        log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null ? e.getCause() : "NULL", e.getMessage(), e);

    } else {
        log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
            joinPoint.getSignature().getName(), e.getCause() != null ? e.getCause() : "NULL");
    }
}