Skip to content

Commit

Permalink
refactor: log error level info -> error in retryAspect
Browse files Browse the repository at this point in the history
  • Loading branch information
minsang-alt committed Dec 24, 2024
1 parent 7fab1bf commit b612982
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
Expand All @@ -21,6 +22,7 @@

@Service
@RequiredArgsConstructor
@Slf4j
public class AmazonSESService implements SMTPService {

private final AmazonSimpleEmailService amazonSimpleEmailService;
Expand All @@ -41,6 +43,7 @@ public CompletableFuture<Void> sendEmail(String subject, Map<String, Object> var

amazonSimpleEmailService.sendEmail(request);
} catch (Exception e) {
log.error("AmazonSESService 이메일 발송 실패: {}", e.getMessage());
throw new GeneralException(ErrorStatus.EMAIL_NOT_SENT);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Object retry(ProceedingJoinPoint joinPoint) throws Throwable {

while (attempts < maxAttempts) {
try {
log.info("시도 #{}", attempts + 1);
log.error("시도 #{}", attempts + 1);
return joinPoint.proceed();
} catch (Exception e) {
attempts++;
Expand All @@ -45,7 +45,7 @@ public Object retry(ProceedingJoinPoint joinPoint) throws Throwable {
throw e;
}

log.warn("재시도 {}/{}", attempts, maxAttempts);
log.error("재시도 {}/{}", attempts, maxAttempts);
Thread.sleep(retry.delay());
}
}
Expand Down

0 comments on commit b612982

Please sign in to comment.