Created
October 17, 2014 17:39
-
-
Save gabanox/680d90253a3bba86314a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.telcel.aspects; | |
import org.aspectj.lang.ProceedingJoinPoint; | |
import org.aspectj.lang.annotation.Around; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.stereotype.Component; | |
@Component | |
@Aspect | |
public class TracingAspect extends CallTracker { | |
Logger logger = LoggerFactory.getLogger(TracingAspect.class); | |
@Around("SystemArchitecture.Repository() || SystemArchitecture.Service()") | |
public void trace(ProceedingJoinPoint proceedingJP) throws Throwable { | |
String methodInformation = proceedingJP.getStaticPart().getSignature().toString(); | |
logger.trace("Entering " + methodInformation); | |
trackCall(); | |
try { | |
proceedingJP.proceed(); | |
} catch (Throwable ex) { | |
logger.error("Exception in " + methodInformation, ex); | |
throw ex; | |
} finally { | |
logger.trace("Exiting " + methodInformation); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment