You can use aspectj without Spring (or log4j) to log messages at any aspectj supported joinpoints,
For example,
public aspect ListAllMethodExecution {
private int callDepth;
private pointcut executionJoinPoints(): !within(ListAllMethodExecution) && execution (* *.*(..));
before(): executionJoinPoints(){
print("Before call " + thisJoinPoint);
callDepth++;
}
after(): executionJoinPoints(){
callDepth--;
print("After call " + thisJoinPoint);
}
private void print(String s){
for(int i=0; i<callDepth; i++)
System.out.print(" ");
System.out.println(s);
}
}
You can modify the pointcut expression to log from a specific packages on specific events or other static joinpoints that you may be interested in.
Also you can modify the print method as you wish to redirect logs.
You can use load time or compile time weaving as suits to you. Hope this helps.