Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] AspectJ multiple projects logging

Hello,
 
I have an issue with AspectJ I just cannot figure out. I have several projects, which all use an individual aspect. This aspect is used to log entering and leaving statements for debug purposes. For this i'm using Log4j 1.2.9. For each project i have a separate log category, which is used by the individual aspect of the class. However, i cannot seem to get these to work properly. All the entering and leaving statements of all projects are currently put into 1 log category. This leads me to suspect that the first aspect is applied to all projects. The aspect contains the following code:
 

// A log category is retrieved for a package level, the particular class is registered in the call

private LogCategory myLog = new LogCategory("AEPOS.Web.Uitvaart", "");


// Declares a pointcut, which is applied for the execution of all methods in all classes

protected pointcut methodLogging() : execution(* *.*(..));

before() : methodLogging() {

CodeSignature sig = (CodeSignature) thisJoinPointStaticPart

.getSignature();

String className = sig.getDeclaringType().getName();

String methodName = sig.getName();

String logString = className + " - " + methodName;

myLog.debug(logString, MyLogCategory.S_ENTERING);

}

Does anybody have any idea why this is happening, or even better, how to fix this? Using eclipse as an IDE.
 
Kind regards,

Hawkeye


Back to the top