diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java index 6b6e8859..f2f24dca 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java @@ -8,7 +8,6 @@ import org.locationtech.jts.geom.Point; import org.springframework.data.domain.Slice; import org.springframework.data.domain.SliceImpl; -import org.springframework.security.core.parameters.P; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import site.timecapsulearchive.core.domain.capsule.data.dto.CapsuleBasicInfoDto; diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/global/log/LoggingComponent.java b/backend/core/src/main/java/site/timecapsulearchive/core/global/log/LoggingComponent.java new file mode 100644 index 00000000..cbc55fac --- /dev/null +++ b/backend/core/src/main/java/site/timecapsulearchive/core/global/log/LoggingComponent.java @@ -0,0 +1,36 @@ +package site.timecapsulearchive.core.global.log; + +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.springframework.stereotype.Component; + +@Slf4j +@Aspect +@Component +public class LoggingComponent { + + @Before("execution(* site.timecapsulearchive..*(..)) " + + "&& !within(site.timecapsulearchive.core.infra..config..*)" + + "&& !within(site.timecapsulearchive.core.domain..api..*)" + + "&& !within(site.timecapsulearchive.core.global..*)" + + "|| within(site.timecapsulearchive.core.global.api..*)" + + "|| within(site.timecapsulearchive.core.global.geography..*)") + public void doTraceBefore(JoinPoint joinPoint) { + Object[] args = joinPoint.getArgs(); + + log.info("[before] {} args={}", joinPoint.getSignature(), args); + } + + @After("execution(* site.timecapsulearchive..*(..)) " + + "&& !within(site.timecapsulearchive.core.infra..config..*)" + + "&& !within(site.timecapsulearchive.core.domain..api..*)" + + "&& !within(site.timecapsulearchive.core.global..*)" + + "|| within(site.timecapsulearchive.core.global.api..*)" + + "|| within(site.timecapsulearchive.core.global.geography..*)") + public void doTraceAfter(JoinPoint joinPoint) { + log.info("[after] {}", joinPoint.getSignature()); + } +} diff --git a/backend/core/src/main/resources/logback-spring.xml b/backend/core/src/main/resources/logback-spring.xml index 4b25a32d..a65de835 100644 --- a/backend/core/src/main/resources/logback-spring.xml +++ b/backend/core/src/main/resources/logback-spring.xml @@ -1,34 +1,55 @@ + + + http://10.0.0.8:3100/loki/api/v1/push + + + + + + { + "level":"%level", + "class":"%logger{36}", + "thread":"%thread", + "message": "%message", + "requestId": "%X{X-Request-ID}" + } + + + + + - - [%d{yyyy-MM-dd HH:mm:ss}:%-3relative][%thread] %-5level %logger{36} - %msg%n + + + %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - [trace] %msg%n - - - - ./logs/info.log - - INFO - - - [%d{yyyy-MM-dd HH:mm:ss}:%-3relative][%thread] %-5level %logger{35} - %msg%n - - - ./logs/info.%d{yyyy-MM-dd}.%i.log.gz - - - 100MB - - 180 - - + + + + + + + + + + + + + + - + - - + + + + + \ No newline at end of file diff --git a/backend/notification/src/main/resources/config b/backend/notification/src/main/resources/config index 1ee7ab86..9340cfd0 160000 --- a/backend/notification/src/main/resources/config +++ b/backend/notification/src/main/resources/config @@ -1 +1 @@ -Subproject commit 1ee7ab86c074698d0e81ba783212e3cd08090a3d +Subproject commit 9340cfd0d1b8c12cb4ad8a7b786e7e6f3ed99a18