Refactor: GatewayLoggingAspect를 axhub-gateway 모듈로 이동 및 포인트컷 최적화
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package io.shinhanlife.axhub.biz.mcp.adapter.aop;
|
||||
package io.shinhanlife.axhub.biz.mcp.gateway.aop;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
@@ -12,11 +12,9 @@ import org.springframework.util.StopWatch;
|
||||
@Component
|
||||
public class GatewayLoggingAspect {
|
||||
|
||||
// controller 및 connector 패키지 하위의 모든 클래스/메서드 실행 시 작동
|
||||
@Around("execution(* io.shinhanlife.axhub.biz.mcp.gateway.controller..*(..)) " +
|
||||
"|| execution(* io.shinhanlife.axhub.biz.mcp.tool.controller..*(..)) " +
|
||||
"|| execution(* io.shinhanlife.axhub.biz.mcp.adapter.connector..*(..))")
|
||||
public Object logConnectorExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
// gateway의 controller 패키지 하위의 모든 클래스/메서드 실행 시 작동
|
||||
@Around("execution(* io.shinhanlife.axhub.biz.mcp.gateway.controller..*(..))")
|
||||
public Object logGatewayExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
String targetMethod = joinPoint.getSignature().toShortString();
|
||||
StopWatch stopWatch = new StopWatch();
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ToolRegistryHeartbeatSender {
|
||||
.toEntity(String.class);
|
||||
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
log.debug(" [HeartbeatSender] 하트비트 전송 성공: {}", tool.getToolName());
|
||||
log.info(" [HeartbeatSender] 하트비트 전송 성공: {}", tool.getToolName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(" [HeartbeatSender] 하트비트 전송 실패 ({}): {}. 재등록을 시도합니다.", tool.getToolName(), e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user