From 5e90bf0eac20f038d699abe5fca8caf23fcfc0c6 Mon Sep 17 00:00:00 2001 From: "AAVN\\pvquan" Date: Thu, 19 Dec 2024 14:18:24 +0700 Subject: [PATCH] test --- .../java/com/axonivy/market/logging/LoggableAspect.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/marketplace-service/src/main/java/com/axonivy/market/logging/LoggableAspect.java b/marketplace-service/src/main/java/com/axonivy/market/logging/LoggableAspect.java index 059a1998..02a7db85 100644 --- a/marketplace-service/src/main/java/com/axonivy/market/logging/LoggableAspect.java +++ b/marketplace-service/src/main/java/com/axonivy/market/logging/LoggableAspect.java @@ -6,8 +6,8 @@ import jakarta.servlet.http.HttpServletRequest; import lombok.extern.log4j.Log4j2; import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -32,12 +32,14 @@ public class LoggableAspect { @Value("${loggable.log-path}") public String logFilePath; - @Before("@annotation(com.axonivy.market.logging.Loggable)") + @Around("@annotation(com.axonivy.market.logging.Loggable)") public void logMethodCall(JoinPoint joinPoint) throws MissingHeaderException { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes != null) { + log.debug("#extractHeaders arguments {} ---- {}", signature.getParameterNames(), joinPoint.getArgs()); + log.info("#extractHeaders arguments {} ---- {}", signature.getParameterNames(), joinPoint.getArgs()); HttpServletRequest request = attributes.getRequest(); Map headersMap = extractHeaders(request, signature, joinPoint); saveLogToDailyFile(headersMap);