Skip to content

Commit e28e850

Browse files
committed
CLAP-184 Add: 예외 발생 시 response 확인을 위한 로깅 추가
1 parent cb5b3c2 commit e28e850

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/clap/server/config/aop/LoggingAspect.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,21 @@ public Object logApiRequests(ProceedingJoinPoint joinPoint) throws Throwable {
5353
Object result = null;
5454
try {
5555
result = joinPoint.proceed();
56+
} catch (Exception ex) {
57+
log.error("Exception occurred: {}", ex.getMessage());
58+
log.info("response.getStatus()={}",response.getStatus());
59+
log.info("getRequestBody()={}", getRequestBody(request));
60+
throw ex;
5661
} finally {
5762
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
5863
LogStatus logType = getLogType(methodSignature);
5964
String customCode = getCustomCode(response);
60-
//TODO: ipv4 형식으로 변환
6165
if (logType != null) {
6266
if (LogStatus.LOGIN.equals(logType)) {
67+
log.info("result={}",result);
68+
log.info("response.getStatus()={}",response.getStatus());
69+
log.info("getRequestBody()={}", getRequestBody(request));
70+
log.info("getNicknameFromRequestBody()={}", getNicknameFromRequestBody(request));
6371
createAnonymousLogsUsecase.createAnonymousLog(request, response, result, logType, customCode, getRequestBody(request), getNicknameFromRequestBody(request));
6472
} else {
6573
if (!isUserAuthenticated()) {

0 commit comments

Comments
 (0)