Skip to content

Commit

Permalink
[FIX] Object 리턴하도록 수정 (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks authored Apr 16, 2024
1 parent 4e24e67 commit 6314dbc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ExecutionLoggingAop {

// 모든 패키지 내의 controller package에 존재하는 클래스
@Around("execution(* synk.meeteam.domain..api..*(..))")
public void logExecutionTrace(ProceedingJoinPoint pjp) throws Throwable {
public Object logExecutionTrace(ProceedingJoinPoint pjp) throws Throwable {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
RequestMethod httpMethod = RequestMethod.valueOf(request.getMethod());

Expand Down Expand Up @@ -51,9 +51,11 @@ public void logExecutionTrace(ProceedingJoinPoint pjp) throws Throwable {
StopWatch sw = new StopWatch();
sw.start();

Object result = null;

// 해당 클래스의 메소드 실행
try{
Object result = pjp.proceed();
result = pjp.proceed();
}
catch (Exception e){
log.warn("[ERROR] " + task + " 메서드 예외 발생 : " + e.getMessage());
Expand All @@ -65,6 +67,8 @@ public void logExecutionTrace(ProceedingJoinPoint pjp) throws Throwable {
long executionTime = sw.getTotalTimeMillis();

log.info("[ExecutionTime] " + task + " --> " + executionTime + " (ms)");

return result;
}

}

0 comments on commit 6314dbc

Please sign in to comment.