Refactor: GatewayLoggingAspect를 axhub-gateway 모듈로 이동 및 포인트컷 최적화

This commit is contained in:
jade
2026-07-06 09:59:45 +09:00
parent 42fa2d8e7a
commit 40c163828e
2 changed files with 6 additions and 8 deletions

View File

@@ -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 lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
@@ -12,11 +12,9 @@ import org.springframework.util.StopWatch;
@Component @Component
public class GatewayLoggingAspect { public class GatewayLoggingAspect {
// controller connector 패키지 하위의 모든 클래스/메서드 실행 작동 // gateway의 controller 패키지 하위의 모든 클래스/메서드 실행 작동
@Around("execution(* io.shinhanlife.axhub.biz.mcp.gateway.controller..*(..)) " + @Around("execution(* io.shinhanlife.axhub.biz.mcp.gateway.controller..*(..))")
"|| execution(* io.shinhanlife.axhub.biz.mcp.tool.controller..*(..)) " + public Object logGatewayExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
"|| execution(* io.shinhanlife.axhub.biz.mcp.adapter.connector..*(..))")
public Object logConnectorExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
String targetMethod = joinPoint.getSignature().toShortString(); String targetMethod = joinPoint.getSignature().toShortString();
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
@@ -38,4 +36,4 @@ public class GatewayLoggingAspect {
} }
} }
} }
} }

View File

@@ -102,7 +102,7 @@ public class ToolRegistryHeartbeatSender {
.toEntity(String.class); .toEntity(String.class);
if (response.getStatusCode().is2xxSuccessful()) { if (response.getStatusCode().is2xxSuccessful()) {
log.debug(" [HeartbeatSender] 하트비트 전송 성공: {}", tool.getToolName()); log.info(" [HeartbeatSender] 하트비트 전송 성공: {}", tool.getToolName());
} }
} catch (Exception e) { } catch (Exception e) {
log.warn(" [HeartbeatSender] 하트비트 전송 실패 ({}): {}. 재등록을 시도합니다.", tool.getToolName(), e.getMessage()); log.warn(" [HeartbeatSender] 하트비트 전송 실패 ({}): {}. 재등록을 시도합니다.", tool.getToolName(), e.getMessage());