All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tosan.http.server.starter.aspect.ServiceLogAspect Maven / Gradle / Ivy

package com.tosan.http.server.starter.aspect;

import com.tosan.http.server.starter.logger.JsonServiceLogger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;

/**
 * @author mina khoshnevisan
 * @since 7/25/2022
 */
@Order(10)
@Aspect
public class ServiceLogAspect {

    private final JsonServiceLogger jsonServiceLogger;

    public ServiceLogAspect(JsonServiceLogger jsonServiceLogger) {
        this.jsonServiceLogger = jsonServiceLogger;
    }

    @Around(value = "execution(* (@org.springframework.web.bind.annotation.RequestMapping *).*(..))")
    public Object log(ProceedingJoinPoint pjp) throws Throwable {
        return jsonServiceLogger.log(pjp);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy