Skip to content
Snippets Groups Projects
Commit 602444c6 authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into e2e-okd-cluster

parents 476def92 35522421
No related branches found
No related tags found
No related merge requests found
...@@ -132,16 +132,6 @@ ...@@ -132,16 +132,6 @@
<artifactId>mapstruct</artifactId> <artifactId>mapstruct</artifactId>
</dependency> </dependency>
<!-- aspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<!-- Dev --> <!-- Dev -->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
......
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
...@@ -35,6 +36,16 @@ ...@@ -35,6 +36,16 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
</dependency> </dependency>
<!-- aspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
...@@ -87,11 +98,13 @@ ...@@ -87,11 +98,13 @@
</goals> </goals>
<configuration> <configuration>
<outputDirectory> <outputDirectory>
${project.build.directory}/classes/META-INF/resources</outputDirectory> ${project.build.directory}/classes/META-INF/resources
</outputDirectory>
<resources> <resources>
<resource> <resource>
<directory> <directory>
../${project.parent.artifactId}-client/dist/apps/goofy/</directory> ../${project.parent.artifactId}-client/dist/apps/goofy/
</directory>
</resource> </resource>
</resources> </resources>
</configuration> </configuration>
......
package de.ozgcloud.alfa.logging;
import org.aspectj.lang.annotation.Pointcut;
public class AlfaAspectPointcuts {
@Pointcut("execution(public * *(..))")
void anyPublicMethods() {
// aspect pointcut - no implementation needed
}
@Pointcut("within(de.ozgcloud..*)")
void anythingInOzgCloud() {
// aspect pointcut - no implementation needed
}
@Pointcut("anyPublicMethods() && anythingInOzgCloud()")
void anyPublicMethodInOzgCloud() {
// aspect pointcut - no implementation needed
}
@Pointcut("anyPublicMethodInOzgCloud() && @target(org.springframework.stereotype.Service)")
void anyPublicServiceMethod() {
// aspect pointcut - no implementation needed
}
@Pointcut("anyPublicMethodInOzgCloud() && @target(org.springframework.web.bind.annotation.RestController)")
void anyPublicRestControllerMethod() {
// aspect pointcut - no implementation needed
}
}
package de.ozgcloud.alfa.logging;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
import de.itvsh.kop.common.logging.AspectLoggingUtils;
@Aspect
@Component
public class AlfaLoggingAspect extends AlfaAspectPointcuts {
@Before("anyPublicServiceMethod() || anyPublicRestControllerMethod()")
public void onLoggedMethod(JoinPoint joinPoint) {
AspectLoggingUtils.log(joinPoint);
}
@AfterThrowing(pointcut = "anyPublicServiceMethod() || anyPublicRestControllerMethod()", throwing = "ex")
public void afterExceptionInLoggedMethod(JoinPoint joinPoint, Exception ex) {
AspectLoggingUtils.logException(joinPoint, ex);
}
@AfterReturning(pointcut = "anyPublicServiceMethod() || anyPublicRestControllerMethod()", returning = "returnValue")
public void afterLoggedMethod(JoinPoint joinPoint, Object returnValue) {
AspectLoggingUtils.logReturnValue(joinPoint, returnValue);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment