Java: printing each method invoked to the console?

I need to understand a fairly large Java project. I look through it using eclipse and use the call hierarchy and that’s it, but that doesn’t give me enough idea of ​​what happens when the project starts (this is a web service).

Is it possible to print every method call using parameters for the console? Basically what puts

System.out.println("methodName, params: " + param1.toString()); 

in every method for me. Some kind of structure that provides this, for example?

+4
source share
1 answer

You should try using Aspect Oriented Programming (AOP).

Here is an example that does more or less what you want: How to use AOP with AspectJ for logging?

+4
source

All Articles